Files
ack-tegra/include/linux
Al Viro 7a4dec5389 Fix sget() race with failing mount
If sget() finds a matching superblock being set up, it'll
grab an active reference to it and grab s_umount.  That's
fine - we'll wait for completion of foofs_get_sb() that way.
However, if said foofs_get_sb() fails we'll end up holding
the halfway-created superblock.  deactivate_locked_super()
called by foofs_get_sb() will just unlock the sucker since
we are holding another active reference to it.

What we need is a way to tell if superblock has been successfully
set up.  Unfortunately, neither ->s_root nor the check for
MS_ACTIVE quite fit.  Cheap and easy way, suitable for backport:
new flag set by the (only) caller of ->get_sb().  If that flag
isn't present by the time sget() grabbed s_umount on preexisting
superblock it has found, it's seeing a stillborn and should
just bury it with deactivate_locked_super() (and repeat the search).

Longer term we want to set that flag in ->get_sb() instances (and
check for it to distinguish between "sget() found us a live sb"
and "sget() has allocated an sb, we need to set it up" in there,
instead of checking ->s_root as we do now).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: stable@kernel.org
2010-08-09 16:49:01 -04:00
..
2010-07-31 14:20:02 +01:00
2010-05-28 01:38:00 +02:00
2010-06-15 09:56:01 +10:00
2010-05-27 09:12:53 -07:00
2010-08-09 16:47:43 -04:00
2010-06-08 18:44:04 +02:00
2010-08-09 16:48:13 -04:00
2010-08-09 16:48:03 -04:00
2010-08-09 16:49:01 -04:00
2010-05-25 08:07:01 -07:00
2010-05-27 09:12:42 -07:00
2010-06-29 10:38:22 -07:00
2010-08-09 16:48:45 -04:00
2010-07-14 17:14:00 +10:00
2010-07-02 21:59:08 -07:00
2010-08-09 16:47:27 -04:00
2010-05-27 09:12:50 -07:00
2010-05-30 09:02:47 -07:00
2010-05-25 11:41:43 -04:00
2010-08-09 16:48:44 -04:00
2010-05-27 09:12:43 -07:00