mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roman Zippel <zippel@linux-m68k.org>
To: Petr Vandrovec <vandrove@vc.cvut.cz>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC] module fs or how to not break everything at once
Date: Thu, 21 Nov 2002 20:46:57 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.44.0211212015340.2113-100000@serv> (raw)
In-Reply-To: <20021121015956.GB1584@ppc.vc.cvut.cz>

Hi,

On Thu, 21 Nov 2002, Petr Vandrovec wrote:

> > Indeed, rmdir should probably also remove the control file.
> 
> Actually I was thinking in opposite way: requiring user to create
> "control", instead of creating it automatically.
> 
> And more I think about it, why there is one "control" for each
> directory? Is not one "control" for whole modfs sufficient?
> fs is then just mounted with existing control, and unmount
> gets rid of it.

I'd rather create a central control file (which might be really the 
cleaner solution), than let the user create it.

> And after implementing releasing of .init as truncate() on
> module file, you can remove directories from modfs completely,
> even more simplifying it.

Directories are likely required, e.g. symbols have to be added and I'm 
still thinking about how to represent the module arguments.

> > module_dir->module is an optimization to get quickly to the module file 
> > created by sys_create_module().
> 
> Ok, I'll try something else. If you'll create module through
> sys_create_module, and remove using echo/rm/rmdir, will not it leak
> dentry?

I noticed that too, but it's easy to fix and not the only leak, as you 
probably noticed. :)

> > > It has unfortunate feature that sys_create_module(); 
> > > sys_delete_module() (without suceeding sys_init_module between
> > > them) will return -ENOENT, and you'll have to use rm/rmdir to get 
> > > rid of module :-(
> > 
> > As the system calls are only temporary, they don't have to be perfect, but 
> > why should it return -ENOINT, AFAICS it should fail for other reason.
> 
> Your current implementation will return -ENOENT because of moddir->module 
> will be NULL: but it is not critical error, it just means that 
> sys_create_module() was called, but sys_init_module() was not, and 
> you should not fail cleanup for such case.

moddir->module is initialized in sys_create_module, so this shouldn't be a 
problem.

> I think that you should not be too clever in insmod/rmmod. Just code
> them like userspace clients will do: open "control", write "exit module"
> and "unmap module" into it, and then unlink "module" and remove
> that directory...

Well, first I have to see if I have to emulate these system calls at all.
I still have to see how much work it will be to reimplement the magic 
do-it-all module load syscall on top of modfs, it probably will be easier 
to keep them separate.

> And do we need separate map/init and exit/unmap? I do not think that
> it should be supported to do map/init/exit/init/exit/unmap...

You first have to map the module into the kernel (or at least reserve the 
space), so you know the address the module has to be relocated to.

> And because of you do not allow unlink() on mapped module,
> what about doing implicit exit/unmap on unlink, removing exit/unmap
> operations from control completely?

For now I'd rather keep a fine grained interface, it can still be 
simplified later.

bye, Roman


  reply	other threads:[~2002-11-21 19:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-20 21:06 Roman Zippel
2002-11-20 22:03 ` Petr Vandrovec
2002-11-20 23:32   ` Roman Zippel
2002-11-21  1:59     ` Petr Vandrovec
2002-11-21 19:46       ` Roman Zippel [this message]
2002-11-21 23:21 Adam J. Richter
2002-11-22 10:50 ` Roman Zippel
2002-11-21 23:59 Adam J. Richter
2002-11-22 18:10 Adam J. Richter
2002-11-22 20:28 ` Roman Zippel
2002-11-22 22:11 Adam J. Richter
2002-11-22 23:24 ` Roman Zippel
2002-11-23  4:58 Adam J. Richter
2002-11-23 12:34 ` Roman Zippel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0211212015340.2113-100000@serv \
    --to=zippel@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vandrove@vc.cvut.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®