Commit 1494583d authored by Al Viro's avatar Al Viro
Browse files

fix get_active_super()/umount() race

This one needs restarts...
Signed-off-by: default avatarAl Viro <>
parent e7fe0585
...@@ -471,17 +471,17 @@ struct super_block *get_active_super(struct block_device *bdev) ...@@ -471,17 +471,17 @@ struct super_block *get_active_super(struct block_device *bdev)
if (!bdev) if (!bdev)
return NULL; return NULL;
spin_lock(&sb_lock); spin_lock(&sb_lock);
list_for_each_entry(sb, &super_blocks, s_list) { list_for_each_entry(sb, &super_blocks, s_list) {
if (list_empty(&sb->s_instances)) if (list_empty(&sb->s_instances))
continue; continue;
if (sb->s_bdev != bdev) if (sb->s_bdev == bdev) {
if (grab_super(sb)) /* drops sb_lock */ if (grab_super(sb)) /* drops sb_lock */
return sb; return sb;
spin_lock(&sb_lock); goto restart;
} }
spin_unlock(&sb_lock); spin_unlock(&sb_lock);
return NULL; return NULL;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment