[lkml]   [2002]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Question about pseudo filesystems
Daniel Phillips wrote:
> > But you've rather cutely arranged that these kinds of mount _do_
> > disappear when the last file being used on them disappears. Clever, if
> > a bit disturbing.
> And it's not a good way to drive module unloading. It is rmmod that
> should cause a module to be unloaded, not close. The final close
> *allows* the module to be unloaded, it does not *cause* it to be. So
> to get the expected behaviour, you have to lather on some other fanciful
> construction to garbage collect modules ready to be unloaded, or to let
> rmmod inquire the state of the module in the process of attempting to
> unload it, and not trigger the nasty races we've discussed. Enter
> fancy locking regime that 3 people in the world actually understand.

Eh? In this case, Al Viro's scheme is really simple and works: the
kern_mount keeps the module use-count non-zero so long as any file
descriptors are using the module's filesystem. fput() decrements the
use-count at a safe time -- no race conditions.

The expected behaviour is as it has always been: rmmod fails if anyone
is using the module, and succeeds if nobody is using the module. The
garbage collection of modules is done using "rmmod -a" periodically, as
it always has been.

-- Jamie
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:28    [W:0.223 / U:1.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site