[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100324051223.10015.75309.stgit@notabene.brown>
Date: Wed, 24 Mar 2010 16:12:23 +1100
From: NeilBrown <neilb@...e.de>
To: Al Viro <viro@...IV.linux.org.uk>
Cc: Christoph Hellwig <hch@....de>, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] VFS: use __put_super_and_need_restart in get_active_super.
The recently-added get_active_super() walks the super_blocks
list but unlike all other code that walks this list it does
not use __put_super_and_need_restart().
I believe this is an omission that should be fixed.
cc: Christoph Hellwig <hch@....de>
Signed-off-by: NeilBrown <neilb@...e.de>
---
fs/super.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/fs/super.c b/fs/super.c
index f35ac60..34c8391 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -482,6 +482,7 @@ struct super_block *get_active_super(struct block_device *bdev)
return NULL;
spin_lock(&sb_lock);
+restart:
list_for_each_entry(sb, &super_blocks, s_list) {
if (sb->s_bdev != bdev)
continue;
@@ -500,9 +501,10 @@ struct super_block *get_active_super(struct block_device *bdev)
spin_unlock(&sb_lock);
}
up_write(&sb->s_umount);
- put_super(sb);
yield();
spin_lock(&sb_lock);
+ if (__put_super_and_need_restart(sb))
+ goto restart;
}
spin_unlock(&sb_lock);
return NULL;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists