linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vfs: remove unneeded hlist_unhashed check from get_active_super
@ 2014-10-14 10:36 Jeff Layton
  2014-10-14 11:11 ` Jeff Layton
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Layton @ 2014-10-14 10:36 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel, trond.myklebust, tao.peng

As best I can tell, a superblock is only ever removed from the fs_supers
list after the s_active counter goes to zero. Thus, the hlist_unhashed
check here is redundant, since the atomic_inc_not_zero check in
grab_super will catch that case anyway.

Cc: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
---
 fs/super.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/fs/super.c b/fs/super.c
index eae088f6aaae..7ff277547c1e 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -320,9 +320,7 @@ EXPORT_SYMBOL(deactivate_super);
  *	and want to turn it into a full-blown active reference.  grab_super()
  *	is called with sb_lock held and drops it.  Returns 1 in case of
  *	success, 0 if we had failed (superblock contents was already dead or
- *	dying when grab_super() had been called).  Note that this is only
- *	called for superblocks not in rundown mode (== ones still on ->fs_supers
- *	of their type), so increment of ->s_count is OK here.
+ *	dying when grab_super() had been called).
  */
 static int grab_super(struct super_block *s) __releases(sb_lock)
 {
@@ -641,8 +639,6 @@ struct super_block *get_active_super(struct block_device *bdev)
 restart:
 	spin_lock(&sb_lock);
 	list_for_each_entry(sb, &super_blocks, s_list) {
-		if (hlist_unhashed(&sb->s_instances))
-			continue;
 		if (sb->s_bdev == bdev) {
 			if (!grab_super(sb))
 				goto restart;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-10-14 23:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-14 10:36 [PATCH] vfs: remove unneeded hlist_unhashed check from get_active_super Jeff Layton
2014-10-14 11:11 ` Jeff Layton
2014-10-14 19:13   ` Al Viro
2014-10-14 19:19     ` Jeff Layton
2014-10-14 23:05       ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).