aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/alpha/kernel/osf_sys.c3
-rw-r--r--fs/compat.c2
-rw-r--r--fs/namespace.c4
3 files changed, 2 insertions, 7 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 42ee05981e71..9a3334ae282e 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -371,8 +371,6 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path,
371 int retval = -EINVAL; 371 int retval = -EINVAL;
372 char *name; 372 char *name;
373 373
374 lock_kernel();
375
376 name = getname(path); 374 name = getname(path);
377 retval = PTR_ERR(name); 375 retval = PTR_ERR(name);
378 if (IS_ERR(name)) 376 if (IS_ERR(name))
@@ -392,7 +390,6 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path,
392 } 390 }
393 putname(name); 391 putname(name);
394 out: 392 out:
395 unlock_kernel();
396 return retval; 393 return retval;
397} 394}
398 395
diff --git a/fs/compat.c b/fs/compat.c
index bb2a9b2e8173..6aefb776dfeb 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -812,10 +812,8 @@ asmlinkage long compat_sys_mount(char __user * dev_name, char __user * dir_name,
812 } 812 }
813 } 813 }
814 814
815 lock_kernel();
816 retval = do_mount((char*)dev_page, dir_page, (char*)type_page, 815 retval = do_mount((char*)dev_page, dir_page, (char*)type_page,
817 flags, (void*)data_page); 816 flags, (void*)data_page);
818 unlock_kernel();
819 817
820 out4: 818 out4:
821 free_page(data_page); 819 free_page(data_page);
diff --git a/fs/namespace.c b/fs/namespace.c
index 7e537f0393b5..4740f7bdb556 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1921,6 +1921,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
1921 if (retval) 1921 if (retval)
1922 goto dput_out; 1922 goto dput_out;
1923 1923
1924 lock_kernel();
1924 if (flags & MS_REMOUNT) 1925 if (flags & MS_REMOUNT)
1925 retval = do_remount(&path, flags & ~MS_REMOUNT, mnt_flags, 1926 retval = do_remount(&path, flags & ~MS_REMOUNT, mnt_flags,
1926 data_page); 1927 data_page);
@@ -1933,6 +1934,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
1933 else 1934 else
1934 retval = do_new_mount(&path, type_page, flags, mnt_flags, 1935 retval = do_new_mount(&path, type_page, flags, mnt_flags,
1935 dev_name, data_page); 1936 dev_name, data_page);
1937 unlock_kernel();
1936dput_out: 1938dput_out:
1937 path_put(&path); 1939 path_put(&path);
1938 return retval; 1940 return retval;
@@ -2046,10 +2048,8 @@ SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name,
2046 if (retval < 0) 2048 if (retval < 0)
2047 goto out3; 2049 goto out3;
2048 2050
2049 lock_kernel();
2050 retval = do_mount((char *)dev_page, dir_page, (char *)type_page, 2051 retval = do_mount((char *)dev_page, dir_page, (char *)type_page,
2051 flags, (void *)data_page); 2052 flags, (void *)data_page);
2052 unlock_kernel();
2053 free_page(data_page); 2053 free_page(data_page);
2054 2054
2055out3: 2055out3: