Re: get_sb_single/bdev/nodev asymmetry - a bug?

From: Alexander Viro (aviro@redhat.com)
Date: Wed May 10 2000 - 03:14:33 EST


On Wed, 10 May 2000, Tigran Aivazian wrote:

> Hi Alexander,
>
> I noticed that mount_sem is down'd and up'd in bdev/nodev versions of
> get_sb_XXX() but only down'd in get_sb_single(). I also see that the
> caller (do_sys_mount) does up(&mount_sem) but never downs it. I thought
> up() without a down() is illegal..

Check them again. Hint: there is no error handling in get_sb_single() (and
no need for it).

> Shouldn't get_sb_single() up it or should the other two *not* up it and
> let do_sys_mount do it? (i.e. whether the rest of the code in
> do_sys_mount() has to be protected by mount_sem or not).

Nope. Reread the code - this stuff behaves in seriously different ways
depending on success/failure of get_sb_foo().

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:15 EST