aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-05-08 13:36:58 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-11 21:36:08 -0400
commit4aa98cf768b6f2ea4b204620d949a665959214f6 (patch)
treedd6f5be97396b9e1f24a9697524da19463e7a8da /fs
parent7f78d4cd4c5d01864943c22b79df1b6bde923129 (diff)
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')
-rw-r--r--fs/namespace.c10
-rw-r--r--fs/super.c16
2 files changed, 13 insertions, 13 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index b94325f00c5a..2dd333b0fe7f 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1060,11 +1060,8 @@ static int do_umount(struct vfsmount *mnt, int flags)
1060 * we just try to remount it readonly. 1060 * we just try to remount it readonly.
1061 */ 1061 */
1062 down_write(&sb->s_umount); 1062 down_write(&sb->s_umount);
1063 if (!(sb->s_flags & MS_RDONLY)) { 1063 if (!(sb->s_flags & MS_RDONLY))
1064 lock_kernel();
1065 retval = do_remount_sb(sb, MS_RDONLY, NULL, 0); 1064 retval = do_remount_sb(sb, MS_RDONLY, NULL, 0);
1066 unlock_kernel();
1067 }
1068 up_write(&sb->s_umount); 1065 up_write(&sb->s_umount);
1069 return retval; 1066 return retval;
1070 } 1067 }
@@ -1515,11 +1512,8 @@ static int do_remount(struct path *path, int flags, int mnt_flags,
1515 down_write(&sb->s_umount); 1512 down_write(&sb->s_umount);
1516 if (flags & MS_BIND) 1513 if (flags & MS_BIND)
1517 err = change_mount_flags(path->mnt, flags); 1514 err = change_mount_flags(path->mnt, flags);
1518 else { 1515 else
1519 lock_kernel();
1520 err = do_remount_sb(sb, flags, data, 0); 1516 err = do_remount_sb(sb, flags, data, 0);
1521 unlock_kernel();
1522 }
1523 if (!err) 1517 if (!err)
1524 path->mnt->mnt_flags = mnt_flags; 1518 path->mnt->mnt_flags = mnt_flags;
1525 up_write(&sb->s_umount); 1519 up_write(&sb->s_umount);
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)
542 shrink_dcache_sb(sb); 542 shrink_dcache_sb(sb);
543 sync_filesystem(sb); 543 sync_filesystem(sb);
544 544
545 lock_kernel();
545 /* If we are remounting RDONLY and current sb is read/write, 546 /* If we are remounting RDONLY and current sb is read/write,
546 make sure there are no rw files opened */ 547 make sure there are no rw files opened */
547 if ((flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY)) { 548 if ((flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY)) {
548 if (force) 549 if (force)
549 mark_files_ro(sb); 550 mark_files_ro(sb);
550 else if (!fs_may_remount_ro(sb)) 551 else if (!fs_may_remount_ro(sb)) {
552 unlock_kernel();
551 return -EBUSY; 553 return -EBUSY;
554 }
552 retval = vfs_dq_off(sb, 1); 555 retval = vfs_dq_off(sb, 1);
553 if (retval < 0 && retval != -ENOSYS) 556 if (retval < 0 && retval != -ENOSYS) {
557 unlock_kernel();
554 return -EBUSY; 558 return -EBUSY;
559 }
555 } 560 }
556 remount_rw = !(flags & MS_RDONLY) && (sb->s_flags & MS_RDONLY); 561 remount_rw = !(flags & MS_RDONLY) && (sb->s_flags & MS_RDONLY);
557 562
558 if (sb->s_op->remount_fs) { 563 if (sb->s_op->remount_fs) {
559 retval = sb->s_op->remount_fs(sb, &flags, data); 564 retval = sb->s_op->remount_fs(sb, &flags, data);
560 if (retval) 565 if (retval) {
566 unlock_kernel();
561 return retval; 567 return retval;
568 }
562 } 569 }
563 sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK); 570 sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK);
571 unlock_kernel();
564 if (remount_rw) 572 if (remount_rw)
565 vfs_dq_quota_on_remount(sb); 573 vfs_dq_quota_on_remount(sb);
566 return 0; 574 return 0;
@@ -581,9 +589,7 @@ static void do_emergency_remount(struct work_struct *work)
581 * 589 *
582 * What lock protects sb->s_flags?? 590 * What lock protects sb->s_flags??
583 */ 591 */
584 lock_kernel();
585 do_remount_sb(sb, MS_RDONLY, NULL, 1); 592 do_remount_sb(sb, MS_RDONLY, NULL, 1);
586 unlock_kernel();
587 } 593 }
588 up_write(&sb->s_umount); 594 up_write(&sb->s_umount);
589 put_super(sb); 595 put_super(sb);