From: NeilBrown on
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(a)lst.de>
Signed-off-by: NeilBrown <neilb(a)suse.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(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/