Push BKL into do_mount()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 8 May 2009 17:31:17 +0000 (13:31 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 12 Jun 2009 01:36:08 +0000 (21:36 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/alpha/kernel/osf_sys.c
fs/compat.c
fs/namespace.c

index 42ee05981e7173d39ac6e047dabce5b46075669b..9a3334ae282e38345d177e060acc2021fdeda084 100644 (file)
@@ -371,8 +371,6 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path,
        int retval = -EINVAL;
        char *name;
 
-       lock_kernel();
-
        name = getname(path);
        retval = PTR_ERR(name);
        if (IS_ERR(name))
@@ -392,7 +390,6 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path,
        }
        putname(name);
  out:
-       unlock_kernel();
        return retval;
 }
 
index bb2a9b2e81738819491a7ae23e0c66be36abc39f..6aefb776dfeb6a86bc4cd6e0fbc40aef916df028 100644 (file)
@@ -812,10 +812,8 @@ asmlinkage long compat_sys_mount(char __user * dev_name, char __user * dir_name,
                }
        }
 
-       lock_kernel();
        retval = do_mount((char*)dev_page, dir_page, (char*)type_page,
                        flags, (void*)data_page);
-       unlock_kernel();
 
  out4:
        free_page(data_page);
index 7e537f0393b58cccd9ac70efe56f0ae0d95199cb..4740f7bdb556289c789daac2ad2dd9035d802e70 100644 (file)
@@ -1921,6 +1921,7 @@ 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);
@@ -1933,6 +1934,7 @@ 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;
@@ -2046,10 +2048,8 @@ SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name,
        if (retval < 0)
                goto out3;
 
-       lock_kernel();
        retval = do_mount((char *)dev_page, dir_page, (char *)type_page,
                          flags, (void *)data_page);
-       unlock_kernel();
        free_page(data_page);
 
 out3: