aboutsummaryrefslogtreecommitdiffstats
path: root/fs/super.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-05-05 23:48:50 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-11 21:36:07 -0400
commit443b94baaa16771e98b29ca7c24f1e305738ffca (patch)
treecf498a25d012330928e0315222c46ea90c200530 /fs/super.c
parent5af7926ff33b68b3ba46531471c6e0564b285efc (diff)
Make sure that all callers of remount hold s_umount exclusive
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/super.c')
-rw-r--r--fs/super.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/super.c b/fs/super.c
index cb19fffc768..49f670cb9a8 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -579,7 +579,7 @@ static void do_emergency_remount(struct work_struct *work)
579 list_for_each_entry(sb, &super_blocks, s_list) { 579 list_for_each_entry(sb, &super_blocks, s_list) {
580 sb->s_count++; 580 sb->s_count++;
581 spin_unlock(&sb_lock); 581 spin_unlock(&sb_lock);
582 down_read(&sb->s_umount); 582 down_write(&sb->s_umount);
583 if (sb->s_root && sb->s_bdev && !(sb->s_flags & MS_RDONLY)) { 583 if (sb->s_root && sb->s_bdev && !(sb->s_flags & MS_RDONLY)) {
584 /* 584 /*
585 * ->remount_fs needs lock_kernel(). 585 * ->remount_fs needs lock_kernel().
@@ -590,7 +590,8 @@ static void do_emergency_remount(struct work_struct *work)
590 do_remount_sb(sb, MS_RDONLY, NULL, 1); 590 do_remount_sb(sb, MS_RDONLY, NULL, 1);
591 unlock_kernel(); 591 unlock_kernel();
592 } 592 }
593 drop_super(sb); 593 up_write(&sb->s_umount);
594 put_super(sb);
594 spin_lock(&sb_lock); 595 spin_lock(&sb_lock);
595 } 596 }
596 spin_unlock(&sb_lock); 597 spin_unlock(&sb_lock);