Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147852
b: refs/heads/master
c: 4aa98cf
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Jun 12, 2009
1 parent 4e9511c commit 73103aa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7f78d4cd4c5d01864943c22b79df1b6bde923129
refs/heads/master: 4aa98cf768b6f2ea4b204620d949a665959214f6
10 changes: 2 additions & 8 deletions trunk/fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1060,11 +1060,8 @@ static int do_umount(struct vfsmount *mnt, int flags)
* we just try to remount it readonly.
*/
down_write(&sb->s_umount);
if (!(sb->s_flags & MS_RDONLY)) {
lock_kernel();
if (!(sb->s_flags & MS_RDONLY))
retval = do_remount_sb(sb, MS_RDONLY, NULL, 0);
unlock_kernel();
}
up_write(&sb->s_umount);
return retval;
}
Expand Down Expand Up @@ -1515,11 +1512,8 @@ static int do_remount(struct path *path, int flags, int mnt_flags,
down_write(&sb->s_umount);
if (flags & MS_BIND)
err = change_mount_flags(path->mnt, flags);
else {
lock_kernel();
else
err = do_remount_sb(sb, flags, data, 0);
unlock_kernel();
}
if (!err)
path->mnt->mnt_flags = mnt_flags;
up_write(&sb->s_umount);
Expand Down
16 changes: 11 additions & 5 deletions trunk/fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 73103aa

Please sign in to comment.