aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/block_dev.c1
-rw-r--r--fs/super.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 6dcee88c2e5d..39cb6591d37d 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -245,6 +245,7 @@ struct super_block *freeze_bdev(struct block_device *bdev)
245 sb = get_active_super(bdev); 245 sb = get_active_super(bdev);
246 if (!sb) 246 if (!sb)
247 goto out; 247 goto out;
248 down_write(&sb->s_umount);
248 if (sb->s_flags & MS_RDONLY) { 249 if (sb->s_flags & MS_RDONLY) {
249 sb->s_frozen = SB_FREEZE_TRANS; 250 sb->s_frozen = SB_FREEZE_TRANS;
250 up_write(&sb->s_umount); 251 up_write(&sb->s_umount);
diff --git a/fs/super.c b/fs/super.c
index dba74e718751..61fa181faa43 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -210,7 +210,6 @@ static int grab_super(struct super_block *s) __releases(sb_lock)
210{ 210{
211 if (atomic_inc_not_zero(&s->s_active)) { 211 if (atomic_inc_not_zero(&s->s_active)) {
212 spin_unlock(&sb_lock); 212 spin_unlock(&sb_lock);
213 down_write(&s->s_umount);
214 return 1; 213 return 1;
215 } 214 }
216 /* it's going away */ 215 /* it's going away */
@@ -317,6 +316,7 @@ retry:
317 up_write(&s->s_umount); 316 up_write(&s->s_umount);
318 destroy_super(s); 317 destroy_super(s);
319 } 318 }
319 down_write(&old->s_umount);
320 return old; 320 return old;
321 } 321 }
322 } 322 }
@@ -466,7 +466,7 @@ EXPORT_SYMBOL(get_super);
466 * 466 *
467 * Scans the superblock list and finds the superblock of the file system 467 * Scans the superblock list and finds the superblock of the file system
468 * mounted on the device given. Returns the superblock with an active 468 * mounted on the device given. Returns the superblock with an active
469 * reference and s_umount held exclusively or %NULL if none was found. 469 * reference or %NULL if none was found.
470 */ 470 */
471struct super_block *get_active_super(struct block_device *bdev) 471struct super_block *get_active_super(struct block_device *bdev)
472{ 472{