On Sun, Jul 30, 2000 at 06:28:11PM -0400, Alexander Viro wrote:
>
>
> On Mon, 31 Jul 2000, Andi Kleen wrote:
>
> > On Sun, Jul 30, 2000 at 06:04:16PM -0400, Alexander Viro wrote:
> > >
> > >
> > > On Sun, 30 Jul 2000, Andi Kleen wrote:
> > >
> > > >
> > > > kern_mount currently forgets to increase the module count of the file system,
> > > > leading to negative module count after umount.
> > >
> > > That's because it is not supposed to be used more than once or to be
> > > undone by umount(). If it _would_ increment the counter you would be
> > > unable to get rid of the module once it's loaded. What are you actually
> > > trying to do?
> >
> > It is not even done once. I was just writing a small module that registers
> > a private file system similar to sockfs.
>
> Great, so why locking it in-core? It should be done when you mount it, not
> when you register.
It is mounted in the module too (it is a fileless file system like sockfs
and does not have a file system mount point, so it can do that).
Anyways, the problem is that the mounting does not increase the module
count, but the umount does.
>
> > IMHO kern_mount should increase the count so that it is symmetric with
> > kern_umount
>
> <blinks> How TF did kern_umount() come to decrement it? Oh, I see -
> side effect of kill_super()... OK, _that_ must be fixed. By adding
> get_filesystem(sb->s_type); before the call of kill_super(sb, 0); in
> kern_umount().
I'm not sure I follow, but shouldn't mounting increase the fs module count?
How else would you do module count management for file systems ?
-Andi