Commit bb29ae49 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] remount_fs needs lock_kernel()

The new emergency remount path forgot to take lock_kernel(), which is
required for ->remount_fs().
parent ddc7ccd3
...@@ -488,8 +488,16 @@ static void do_emergency_remount(unsigned long foo) ...@@ -488,8 +488,16 @@ static void do_emergency_remount(unsigned long foo)
sb->s_count++; sb->s_count++;
spin_unlock(&sb_lock); spin_unlock(&sb_lock);
down_read(&sb->s_umount); down_read(&sb->s_umount);
if (sb->s_root && sb->s_bdev && !(sb->s_flags & MS_RDONLY)) if (sb->s_root && sb->s_bdev && !(sb->s_flags & MS_RDONLY)) {
/*
* ->remount_fs needs lock_kernel().
*
* What lock protects sb->s_flags??
*/
lock_kernel();
do_remount_sb(sb, MS_RDONLY, NULL, 1); do_remount_sb(sb, MS_RDONLY, NULL, 1);
unlock_kernel();
}
drop_super(sb); drop_super(sb);
spin_lock(&sb_lock); spin_lock(&sb_lock);
} }
......
Markdown is supported
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