summaryrefslogtreecommitdiff
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-05-08 13:34:06 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-11 21:36:08 -0400
commit7f78d4cd4c5d01864943c22b79df1b6bde923129 (patch)
treec232d14121976caa8a38e49d6a8a555e99e27c04 /fs/namespace.c
parent6fac98dd218653c6aff8a0f56305c424930cea2a (diff)
downloadlinux-3.10-7f78d4cd4c5d01864943c22b79df1b6bde923129.tar.gz
linux-3.10-7f78d4cd4c5d01864943c22b79df1b6bde923129.tar.bz2
linux-3.10-7f78d4cd4c5d01864943c22b79df1b6bde923129.zip
Push BKL down beyond VFS-only parts of do_mount()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 4740f7bdb55..b94325f00c5 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1515,8 +1515,11 @@ 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
+ else {
+ lock_kernel();
err = do_remount_sb(sb, flags, data, 0);
+ unlock_kernel();
+ }
if (!err)
path->mnt->mnt_flags = mnt_flags;
up_write(&sb->s_umount);
@@ -1630,7 +1633,9 @@ static int do_new_mount(struct path *path, char *type, int flags,
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
+ lock_kernel();
mnt = do_kern_mount(type, flags, name, data);
+ unlock_kernel();
if (IS_ERR(mnt))
return PTR_ERR(mnt);
@@ -1921,7 +1926,6 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
if (retval)
goto dput_out;
- lock_kernel();
if (flags & MS_REMOUNT)
retval = do_remount(&path, flags & ~MS_REMOUNT, mnt_flags,
data_page);
@@ -1934,7 +1938,6 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
else
retval = do_new_mount(&path, type_page, flags, mnt_flags,
dev_name, data_page);
- unlock_kernel();
dput_out:
path_put(&path);
return retval;