aboutsummaryrefslogtreecommitdiffstats
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
parent6fac98dd218653c6aff8a0f56305c424930cea2a (diff)
Push BKL down beyond VFS-only parts of do_mount()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/namespace.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 4740f7bdb556..b94325f00c5a 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,
1515 down_write(&sb->s_umount); 1515 down_write(&sb->s_umount);
1516 if (flags & MS_BIND) 1516 if (flags & MS_BIND)
1517 err = change_mount_flags(path->mnt, flags); 1517 err = change_mount_flags(path->mnt, flags);
1518 else 1518 else {
1519 lock_kernel();
1519 err = do_remount_sb(sb, flags, data, 0); 1520 err = do_remount_sb(sb, flags, data, 0);
1521 unlock_kernel();
1522 }
1520 if (!err) 1523 if (!err)
1521 path->mnt->mnt_flags = mnt_flags; 1524 path->mnt->mnt_flags = mnt_flags;
1522 up_write(&sb->s_umount); 1525 up_write(&sb->s_umount);
@@ -1630,7 +1633,9 @@ static int do_new_mount(struct path *path, char *type, int flags,
1630 if (!capable(CAP_SYS_ADMIN)) 1633 if (!capable(CAP_SYS_ADMIN))
1631 return -EPERM; 1634 return -EPERM;
1632 1635
1636 lock_kernel();
1633 mnt = do_kern_mount(type, flags, name, data); 1637 mnt = do_kern_mount(type, flags, name, data);
1638 unlock_kernel();
1634 if (IS_ERR(mnt)) 1639 if (IS_ERR(mnt))
1635 return PTR_ERR(mnt); 1640 return PTR_ERR(mnt);
1636 1641
@@ -1921,7 +1926,6 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
1921 if (retval) 1926 if (retval)
1922 goto dput_out; 1927 goto dput_out;
1923 1928
1924 lock_kernel();
1925 if (flags & MS_REMOUNT) 1929 if (flags & MS_REMOUNT)
1926 retval = do_remount(&path, flags & ~MS_REMOUNT, mnt_flags, 1930 retval = do_remount(&path, flags & ~MS_REMOUNT, mnt_flags,
1927 data_page); 1931 data_page);
@@ -1934,7 +1938,6 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
1934 else 1938 else
1935 retval = do_new_mount(&path, type_page, flags, mnt_flags, 1939 retval = do_new_mount(&path, type_page, flags, mnt_flags,
1936 dev_name, data_page); 1940 dev_name, data_page);
1937 unlock_kernel();
1938dput_out: 1941dput_out:
1939 path_put(&path); 1942 path_put(&path);
1940 return retval; 1943 return retval;