Re: [PATCH] vfs: remove unneeded hlist_unhashed check from get_active_super

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 14, 2014 at 07:11:34AM -0400, Jeff Layton wrote:

> Ugh. Now that I've sent the patch, I think this is bogus, so I'll go
> ahead and NAK it myself...
> 
> The problem is not the s_active counter, but the fact that grab_super
> bumps the s_count unconditionally. So, this code seems to be using the
> hlist_unhashed check to verify that it's ok to bump the s_count there.
> 
> That said, I don't quite get why it uses that as the check -- would it
> not be more straightforward to simply have grab_super and other callers
> check for a 0->1 transition of the s_count?

Because there might be *other* holders of ->s_count waiting to run down.
Basically, you reintroduce a nasty livelock that way.  Once the
superblock is past the shutdown, ->s_count can go only down.  Somebody
might be holding it while waiting for ->s_umount to be acquired, but
all such processes will detect that it's dead as soon as they get
->s_umount, drop it and drop ->s_count.  Allowing e.g. grab_super() to
_increment_ ->s_count and try to get ->s_umount at that stage would
reopen a livelock we used to have.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux