Skip to content

Commit

Permalink
Make sure that all callers of remount hold s_umount exclusive
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jun 12, 2009
1 parent 5af7926 commit 443b94b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ static void do_emergency_remount(struct work_struct *work)
list_for_each_entry(sb, &super_blocks, s_list) {
sb->s_count++;
spin_unlock(&sb_lock);
down_read(&sb->s_umount);
down_write(&sb->s_umount);
if (sb->s_root && sb->s_bdev && !(sb->s_flags & MS_RDONLY)) {
/*
* ->remount_fs needs lock_kernel().
Expand All @@ -590,7 +590,8 @@ static void do_emergency_remount(struct work_struct *work)
do_remount_sb(sb, MS_RDONLY, NULL, 1);
unlock_kernel();
}
drop_super(sb);
up_write(&sb->s_umount);
put_super(sb);
spin_lock(&sb_lock);
}
spin_unlock(&sb_lock);
Expand Down

0 comments on commit 443b94b

Please sign in to comment.