diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-05-08 13:36:58 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-11 21:36:08 -0400 |
commit | 4aa98cf768b6f2ea4b204620d949a665959214f6 (patch) | |
tree | dd6f5be97396b9e1f24a9697524da19463e7a8da /fs/super.c | |
parent | 7f78d4cd4c5d01864943c22b79df1b6bde923129 (diff) | |
download | lwn-4aa98cf768b6f2ea4b204620d949a665959214f6.tar.gz lwn-4aa98cf768b6f2ea4b204620d949a665959214f6.zip |
Push BKL down into do_remount_sb()
[folded fix from Jiri Slaby]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/super.c')
-rw-r--r-- | fs/super.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/fs/super.c b/fs/super.c index 2a49fed77453..a64f36208797 100644 --- a/fs/super.c +++ b/fs/super.c @@ -542,25 +542,33 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force) shrink_dcache_sb(sb); sync_filesystem(sb); + lock_kernel(); /* If we are remounting RDONLY and current sb is read/write, make sure there are no rw files opened */ if ((flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY)) { if (force) mark_files_ro(sb); - else if (!fs_may_remount_ro(sb)) + else if (!fs_may_remount_ro(sb)) { + unlock_kernel(); return -EBUSY; + } retval = vfs_dq_off(sb, 1); - if (retval < 0 && retval != -ENOSYS) + if (retval < 0 && retval != -ENOSYS) { + unlock_kernel(); return -EBUSY; + } } remount_rw = !(flags & MS_RDONLY) && (sb->s_flags & MS_RDONLY); if (sb->s_op->remount_fs) { retval = sb->s_op->remount_fs(sb, &flags, data); - if (retval) + if (retval) { + unlock_kernel(); return retval; + } } sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK); + unlock_kernel(); if (remount_rw) vfs_dq_quota_on_remount(sb); return 0; @@ -581,9 +589,7 @@ static void do_emergency_remount(struct work_struct *work) * * What lock protects sb->s_flags?? */ - lock_kernel(); do_remount_sb(sb, MS_RDONLY, NULL, 1); - unlock_kernel(); } up_write(&sb->s_umount); put_super(sb); |