diff options
Diffstat (limited to 'fs/super.c')
-rw-r--r-- | fs/super.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/super.c b/fs/super.c index 4df8233dfb61..44971d7df1ce 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -471,17 +471,17 @@ struct super_block *get_active_super(struct block_device *bdev) | |||
471 | if (!bdev) | 471 | if (!bdev) |
472 | return NULL; | 472 | return NULL; |
473 | 473 | ||
474 | restart: | ||
474 | spin_lock(&sb_lock); | 475 | spin_lock(&sb_lock); |
475 | list_for_each_entry(sb, &super_blocks, s_list) { | 476 | list_for_each_entry(sb, &super_blocks, s_list) { |
476 | if (list_empty(&sb->s_instances)) | 477 | if (list_empty(&sb->s_instances)) |
477 | continue; | 478 | continue; |
478 | if (sb->s_bdev != bdev) | 479 | if (sb->s_bdev == bdev) { |
479 | continue; | 480 | if (grab_super(sb)) /* drops sb_lock */ |
480 | 481 | return sb; | |
481 | if (grab_super(sb)) /* drops sb_lock */ | 482 | else |
482 | return sb; | 483 | goto restart; |
483 | 484 | } | |
484 | spin_lock(&sb_lock); | ||
485 | } | 485 | } |
486 | spin_unlock(&sb_lock); | 486 | spin_unlock(&sb_lock); |
487 | return NULL; | 487 | return NULL; |