Commit 6fac98dd authored by Al Viro's avatar Al Viro

Push BKL into do_mount()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent bbd6851a
...@@ -371,8 +371,6 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path, ...@@ -371,8 +371,6 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path,
int retval = -EINVAL; int retval = -EINVAL;
char *name; char *name;
lock_kernel();
name = getname(path); name = getname(path);
retval = PTR_ERR(name); retval = PTR_ERR(name);
if (IS_ERR(name)) if (IS_ERR(name))
...@@ -392,7 +390,6 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path, ...@@ -392,7 +390,6 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path,
} }
putname(name); putname(name);
out: out:
unlock_kernel();
return retval; return retval;
} }
......
...@@ -812,10 +812,8 @@ asmlinkage long compat_sys_mount(char __user * dev_name, char __user * dir_name, ...@@ -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, retval = do_mount((char*)dev_page, dir_page, (char*)type_page,
flags, (void*)data_page); flags, (void*)data_page);
unlock_kernel();
out4: out4:
free_page(data_page); free_page(data_page);
......
...@@ -1921,6 +1921,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page, ...@@ -1921,6 +1921,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
if (retval) if (retval)
goto dput_out; goto dput_out;
lock_kernel();
if (flags & MS_REMOUNT) if (flags & MS_REMOUNT)
retval = do_remount(&path, flags & ~MS_REMOUNT, mnt_flags, retval = do_remount(&path, flags & ~MS_REMOUNT, mnt_flags,
data_page); data_page);
...@@ -1933,6 +1934,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page, ...@@ -1933,6 +1934,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
else else
retval = do_new_mount(&path, type_page, flags, mnt_flags, retval = do_new_mount(&path, type_page, flags, mnt_flags,
dev_name, data_page); dev_name, data_page);
unlock_kernel();
dput_out: dput_out:
path_put(&path); path_put(&path);
return retval; return retval;
...@@ -2046,10 +2048,8 @@ SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name, ...@@ -2046,10 +2048,8 @@ SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name,
if (retval < 0) if (retval < 0)
goto out3; goto out3;
lock_kernel();
retval = do_mount((char *)dev_page, dir_page, (char *)type_page, retval = do_mount((char *)dev_page, dir_page, (char *)type_page,
flags, (void *)data_page); flags, (void *)data_page);
unlock_kernel();
free_page(data_page); free_page(data_page);
out3: out3:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment