diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-24 11:01:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-24 11:01:10 -0400 |
commit | f13771187b9423b824f32518319f6da85d819003 (patch) | |
tree | c431cf16c286065a302d5f3fb43fc1abac7e4047 /fs | |
parent | 15953654cc312429740fd58fb37a5a3d63a54376 (diff) | |
parent | 9f37af654fda88a8dcca74c785f6c20e52758866 (diff) |
Merge branch 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing
* 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing:
uml: Pushdown the bkl from harddog_kern ioctl
sunrpc: Pushdown the bkl from sunrpc cache ioctl
sunrpc: Pushdown the bkl from ioctl
autofs4: Pushdown the bkl from ioctl
uml: Convert to unlocked_ioctls to remove implicit BKL
ncpfs: BKL ioctl pushdown
coda: Clean-up whitespace problems in pioctl.c
coda: BKL ioctl pushdown
drivers: Push down BKL into various drivers
isdn: Push down BKL into ioctl functions
scsi: Push down BKL into ioctl functions
dvb: Push down BKL into ioctl functions
smbfs: Push down BKL into ioctl function
coda/psdev: Remove BKL from ioctl function
um/mmapper: Remove BKL usage
sn_hwperf: Kill BKL usage
hfsplus: Push down BKL into ioctl function
Diffstat (limited to 'fs')
-rw-r--r-- | fs/autofs4/root.c | 22 | ||||
-rw-r--r-- | fs/coda/pioctl.c | 76 | ||||
-rw-r--r-- | fs/coda/psdev.c | 5 | ||||
-rw-r--r-- | fs/hfsplus/dir.c | 2 | ||||
-rw-r--r-- | fs/hfsplus/hfsplus_fs.h | 3 | ||||
-rw-r--r-- | fs/hfsplus/inode.c | 2 | ||||
-rw-r--r-- | fs/hfsplus/ioctl.c | 12 | ||||
-rw-r--r-- | fs/ncpfs/dir.c | 2 | ||||
-rw-r--r-- | fs/ncpfs/file.c | 2 | ||||
-rw-r--r-- | fs/ncpfs/ioctl.c | 27 | ||||
-rw-r--r-- | fs/smbfs/dir.c | 2 | ||||
-rw-r--r-- | fs/smbfs/file.c | 2 | ||||
-rw-r--r-- | fs/smbfs/ioctl.c | 10 | ||||
-rw-r--r-- | fs/smbfs/proto.h | 2 |
14 files changed, 100 insertions, 69 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index e8e5e63ac950..db4117ed7803 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c | |||
@@ -18,13 +18,14 @@ | |||
18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | #include <linux/param.h> | 19 | #include <linux/param.h> |
20 | #include <linux/time.h> | 20 | #include <linux/time.h> |
21 | #include <linux/smp_lock.h> | ||
21 | #include "autofs_i.h" | 22 | #include "autofs_i.h" |
22 | 23 | ||
23 | static int autofs4_dir_symlink(struct inode *,struct dentry *,const char *); | 24 | static int autofs4_dir_symlink(struct inode *,struct dentry *,const char *); |
24 | static int autofs4_dir_unlink(struct inode *,struct dentry *); | 25 | static int autofs4_dir_unlink(struct inode *,struct dentry *); |
25 | static int autofs4_dir_rmdir(struct inode *,struct dentry *); | 26 | static int autofs4_dir_rmdir(struct inode *,struct dentry *); |
26 | static int autofs4_dir_mkdir(struct inode *,struct dentry *,int); | 27 | static int autofs4_dir_mkdir(struct inode *,struct dentry *,int); |
27 | static int autofs4_root_ioctl(struct inode *, struct file *,unsigned int,unsigned long); | 28 | static long autofs4_root_ioctl(struct file *,unsigned int,unsigned long); |
28 | static int autofs4_dir_open(struct inode *inode, struct file *file); | 29 | static int autofs4_dir_open(struct inode *inode, struct file *file); |
29 | static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *); | 30 | static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *); |
30 | static void *autofs4_follow_link(struct dentry *, struct nameidata *); | 31 | static void *autofs4_follow_link(struct dentry *, struct nameidata *); |
@@ -38,7 +39,7 @@ const struct file_operations autofs4_root_operations = { | |||
38 | .read = generic_read_dir, | 39 | .read = generic_read_dir, |
39 | .readdir = dcache_readdir, | 40 | .readdir = dcache_readdir, |
40 | .llseek = dcache_dir_lseek, | 41 | .llseek = dcache_dir_lseek, |
41 | .ioctl = autofs4_root_ioctl, | 42 | .unlocked_ioctl = autofs4_root_ioctl, |
42 | }; | 43 | }; |
43 | 44 | ||
44 | const struct file_operations autofs4_dir_operations = { | 45 | const struct file_operations autofs4_dir_operations = { |
@@ -902,8 +903,8 @@ int is_autofs4_dentry(struct dentry *dentry) | |||
902 | * ioctl()'s on the root directory is the chief method for the daemon to | 903 | * ioctl()'s on the root directory is the chief method for the daemon to |
903 | * generate kernel reactions | 904 | * generate kernel reactions |
904 | */ | 905 | */ |
905 | static int autofs4_root_ioctl(struct inode *inode, struct file *filp, | 906 | static int autofs4_root_ioctl_unlocked(struct inode *inode, struct file *filp, |
906 | unsigned int cmd, unsigned long arg) | 907 | unsigned int cmd, unsigned long arg) |
907 | { | 908 | { |
908 | struct autofs_sb_info *sbi = autofs4_sbi(inode->i_sb); | 909 | struct autofs_sb_info *sbi = autofs4_sbi(inode->i_sb); |
909 | void __user *p = (void __user *)arg; | 910 | void __user *p = (void __user *)arg; |
@@ -947,3 +948,16 @@ static int autofs4_root_ioctl(struct inode *inode, struct file *filp, | |||
947 | return -ENOSYS; | 948 | return -ENOSYS; |
948 | } | 949 | } |
949 | } | 950 | } |
951 | |||
952 | static long autofs4_root_ioctl(struct file *filp, | ||
953 | unsigned int cmd, unsigned long arg) | ||
954 | { | ||
955 | long ret; | ||
956 | struct inode *inode = filp->f_dentry->d_inode; | ||
957 | |||
958 | lock_kernel(); | ||
959 | ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg); | ||
960 | unlock_kernel(); | ||
961 | |||
962 | return ret; | ||
963 | } | ||
diff --git a/fs/coda/pioctl.c b/fs/coda/pioctl.c index 773f2ce9aa06..ca25d96d45c9 100644 --- a/fs/coda/pioctl.c +++ b/fs/coda/pioctl.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Pioctl operations for Coda. | 2 | * Pioctl operations for Coda. |
3 | * Original version: (C) 1996 Peter Braam | 3 | * Original version: (C) 1996 Peter Braam |
4 | * Rewritten for Linux 2.1: (C) 1997 Carnegie Mellon University | 4 | * Rewritten for Linux 2.1: (C) 1997 Carnegie Mellon University |
5 | * | 5 | * |
6 | * Carnegie Mellon encourages users of this code to contribute improvements | 6 | * Carnegie Mellon encourages users of this code to contribute improvements |
@@ -23,21 +23,22 @@ | |||
23 | #include <linux/coda_fs_i.h> | 23 | #include <linux/coda_fs_i.h> |
24 | #include <linux/coda_psdev.h> | 24 | #include <linux/coda_psdev.h> |
25 | 25 | ||
26 | #include <linux/smp_lock.h> | ||
27 | |||
26 | /* pioctl ops */ | 28 | /* pioctl ops */ |
27 | static int coda_ioctl_permission(struct inode *inode, int mask); | 29 | static int coda_ioctl_permission(struct inode *inode, int mask); |
28 | static int coda_pioctl(struct inode * inode, struct file * filp, | 30 | static long coda_pioctl(struct file *filp, unsigned int cmd, |
29 | unsigned int cmd, unsigned long user_data); | 31 | unsigned long user_data); |
30 | 32 | ||
31 | /* exported from this file */ | 33 | /* exported from this file */ |
32 | const struct inode_operations coda_ioctl_inode_operations = | 34 | const struct inode_operations coda_ioctl_inode_operations = { |
33 | { | ||
34 | .permission = coda_ioctl_permission, | 35 | .permission = coda_ioctl_permission, |
35 | .setattr = coda_setattr, | 36 | .setattr = coda_setattr, |
36 | }; | 37 | }; |
37 | 38 | ||
38 | const struct file_operations coda_ioctl_operations = { | 39 | const struct file_operations coda_ioctl_operations = { |
39 | .owner = THIS_MODULE, | 40 | .owner = THIS_MODULE, |
40 | .ioctl = coda_pioctl, | 41 | .unlocked_ioctl = coda_pioctl, |
41 | }; | 42 | }; |
42 | 43 | ||
43 | /* the coda pioctl inode ops */ | 44 | /* the coda pioctl inode ops */ |
@@ -46,48 +47,53 @@ static int coda_ioctl_permission(struct inode *inode, int mask) | |||
46 | return (mask & MAY_EXEC) ? -EACCES : 0; | 47 | return (mask & MAY_EXEC) ? -EACCES : 0; |
47 | } | 48 | } |
48 | 49 | ||
49 | static int coda_pioctl(struct inode * inode, struct file * filp, | 50 | static long coda_pioctl(struct file *filp, unsigned int cmd, |
50 | unsigned int cmd, unsigned long user_data) | 51 | unsigned long user_data) |
51 | { | 52 | { |
52 | struct path path; | 53 | struct path path; |
53 | int error; | 54 | int error; |
54 | struct PioctlData data; | 55 | struct PioctlData data; |
55 | struct inode *target_inode = NULL; | 56 | struct inode *inode = filp->f_dentry->d_inode; |
56 | struct coda_inode_info *cnp; | 57 | struct inode *target_inode = NULL; |
58 | struct coda_inode_info *cnp; | ||
57 | 59 | ||
58 | /* get the Pioctl data arguments from user space */ | 60 | lock_kernel(); |
59 | if (copy_from_user(&data, (void __user *)user_data, sizeof(data))) { | 61 | |
60 | return -EINVAL; | 62 | /* get the Pioctl data arguments from user space */ |
61 | } | 63 | if (copy_from_user(&data, (void __user *)user_data, sizeof(data))) { |
62 | 64 | error = -EINVAL; | |
63 | /* | 65 | goto out; |
64 | * Look up the pathname. Note that the pathname is in | ||
65 | * user memory, and namei takes care of this | ||
66 | */ | ||
67 | if (data.follow) { | ||
68 | error = user_path(data.path, &path); | ||
69 | } else { | ||
70 | error = user_lpath(data.path, &path); | ||
71 | } | 66 | } |
72 | 67 | ||
73 | if ( error ) { | 68 | /* |
74 | return error; | 69 | * Look up the pathname. Note that the pathname is in |
75 | } else { | 70 | * user memory, and namei takes care of this |
71 | */ | ||
72 | if (data.follow) | ||
73 | error = user_path(data.path, &path); | ||
74 | else | ||
75 | error = user_lpath(data.path, &path); | ||
76 | |||
77 | if (error) | ||
78 | goto out; | ||
79 | else | ||
76 | target_inode = path.dentry->d_inode; | 80 | target_inode = path.dentry->d_inode; |
77 | } | 81 | |
78 | |||
79 | /* return if it is not a Coda inode */ | 82 | /* return if it is not a Coda inode */ |
80 | if ( target_inode->i_sb != inode->i_sb ) { | 83 | if (target_inode->i_sb != inode->i_sb) { |
81 | path_put(&path); | 84 | path_put(&path); |
82 | return -EINVAL; | 85 | error = -EINVAL; |
86 | goto out; | ||
83 | } | 87 | } |
84 | 88 | ||
85 | /* now proceed to make the upcall */ | 89 | /* now proceed to make the upcall */ |
86 | cnp = ITOC(target_inode); | 90 | cnp = ITOC(target_inode); |
87 | 91 | ||
88 | error = venus_pioctl(inode->i_sb, &(cnp->c_fid), cmd, &data); | 92 | error = venus_pioctl(inode->i_sb, &(cnp->c_fid), cmd, &data); |
89 | 93 | ||
90 | path_put(&path); | 94 | path_put(&path); |
91 | return error; | ||
92 | } | ||
93 | 95 | ||
96 | out: | ||
97 | unlock_kernel(); | ||
98 | return error; | ||
99 | } | ||
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index be4392ca2098..66b9cf79c5ba 100644 --- a/fs/coda/psdev.c +++ b/fs/coda/psdev.c | |||
@@ -73,8 +73,7 @@ static unsigned int coda_psdev_poll(struct file *file, poll_table * wait) | |||
73 | return mask; | 73 | return mask; |
74 | } | 74 | } |
75 | 75 | ||
76 | static int coda_psdev_ioctl(struct inode * inode, struct file * filp, | 76 | static long coda_psdev_ioctl(struct file * filp, unsigned int cmd, unsigned long arg) |
77 | unsigned int cmd, unsigned long arg) | ||
78 | { | 77 | { |
79 | unsigned int data; | 78 | unsigned int data; |
80 | 79 | ||
@@ -344,7 +343,7 @@ static const struct file_operations coda_psdev_fops = { | |||
344 | .read = coda_psdev_read, | 343 | .read = coda_psdev_read, |
345 | .write = coda_psdev_write, | 344 | .write = coda_psdev_write, |
346 | .poll = coda_psdev_poll, | 345 | .poll = coda_psdev_poll, |
347 | .ioctl = coda_psdev_ioctl, | 346 | .unlocked_ioctl = coda_psdev_ioctl, |
348 | .open = coda_psdev_open, | 347 | .open = coda_psdev_open, |
349 | .release = coda_psdev_release, | 348 | .release = coda_psdev_release, |
350 | }; | 349 | }; |
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index 5f4023678251..764fd1bdca88 100644 --- a/fs/hfsplus/dir.c +++ b/fs/hfsplus/dir.c | |||
@@ -494,7 +494,7 @@ const struct inode_operations hfsplus_dir_inode_operations = { | |||
494 | const struct file_operations hfsplus_dir_operations = { | 494 | const struct file_operations hfsplus_dir_operations = { |
495 | .read = generic_read_dir, | 495 | .read = generic_read_dir, |
496 | .readdir = hfsplus_readdir, | 496 | .readdir = hfsplus_readdir, |
497 | .ioctl = hfsplus_ioctl, | 497 | .unlocked_ioctl = hfsplus_ioctl, |
498 | .llseek = generic_file_llseek, | 498 | .llseek = generic_file_llseek, |
499 | .release = hfsplus_dir_release, | 499 | .release = hfsplus_dir_release, |
500 | }; | 500 | }; |
diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h index 5c10d803d9df..6505c30ad965 100644 --- a/fs/hfsplus/hfsplus_fs.h +++ b/fs/hfsplus/hfsplus_fs.h | |||
@@ -337,8 +337,7 @@ struct inode *hfsplus_new_inode(struct super_block *, int); | |||
337 | void hfsplus_delete_inode(struct inode *); | 337 | void hfsplus_delete_inode(struct inode *); |
338 | 338 | ||
339 | /* ioctl.c */ | 339 | /* ioctl.c */ |
340 | int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | 340 | long hfsplus_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); |
341 | unsigned long arg); | ||
342 | int hfsplus_setxattr(struct dentry *dentry, const char *name, | 341 | int hfsplus_setxattr(struct dentry *dentry, const char *name, |
343 | const void *value, size_t size, int flags); | 342 | const void *value, size_t size, int flags); |
344 | ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name, | 343 | ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name, |
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 1bcf597c0562..9bbb82924a22 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c | |||
@@ -285,7 +285,7 @@ static const struct file_operations hfsplus_file_operations = { | |||
285 | .fsync = file_fsync, | 285 | .fsync = file_fsync, |
286 | .open = hfsplus_file_open, | 286 | .open = hfsplus_file_open, |
287 | .release = hfsplus_file_release, | 287 | .release = hfsplus_file_release, |
288 | .ioctl = hfsplus_ioctl, | 288 | .unlocked_ioctl = hfsplus_ioctl, |
289 | }; | 289 | }; |
290 | 290 | ||
291 | struct inode *hfsplus_new_inode(struct super_block *sb, int mode) | 291 | struct inode *hfsplus_new_inode(struct super_block *sb, int mode) |
diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c index f457d2ca51ab..ac405f099026 100644 --- a/fs/hfsplus/ioctl.c +++ b/fs/hfsplus/ioctl.c | |||
@@ -17,14 +17,16 @@ | |||
17 | #include <linux/mount.h> | 17 | #include <linux/mount.h> |
18 | #include <linux/sched.h> | 18 | #include <linux/sched.h> |
19 | #include <linux/xattr.h> | 19 | #include <linux/xattr.h> |
20 | #include <linux/smp_lock.h> | ||
20 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
21 | #include "hfsplus_fs.h" | 22 | #include "hfsplus_fs.h" |
22 | 23 | ||
23 | int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | 24 | long hfsplus_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
24 | unsigned long arg) | ||
25 | { | 25 | { |
26 | struct inode *inode = filp->f_path.dentry->d_inode; | ||
26 | unsigned int flags; | 27 | unsigned int flags; |
27 | 28 | ||
29 | lock_kernel(); | ||
28 | switch (cmd) { | 30 | switch (cmd) { |
29 | case HFSPLUS_IOC_EXT2_GETFLAGS: | 31 | case HFSPLUS_IOC_EXT2_GETFLAGS: |
30 | flags = 0; | 32 | flags = 0; |
@@ -38,8 +40,10 @@ int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
38 | case HFSPLUS_IOC_EXT2_SETFLAGS: { | 40 | case HFSPLUS_IOC_EXT2_SETFLAGS: { |
39 | int err = 0; | 41 | int err = 0; |
40 | err = mnt_want_write(filp->f_path.mnt); | 42 | err = mnt_want_write(filp->f_path.mnt); |
41 | if (err) | 43 | if (err) { |
44 | unlock_kernel(); | ||
42 | return err; | 45 | return err; |
46 | } | ||
43 | 47 | ||
44 | if (!is_owner_or_cap(inode)) { | 48 | if (!is_owner_or_cap(inode)) { |
45 | err = -EACCES; | 49 | err = -EACCES; |
@@ -85,9 +89,11 @@ int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
85 | mark_inode_dirty(inode); | 89 | mark_inode_dirty(inode); |
86 | setflags_out: | 90 | setflags_out: |
87 | mnt_drop_write(filp->f_path.mnt); | 91 | mnt_drop_write(filp->f_path.mnt); |
92 | unlock_kernel(); | ||
88 | return err; | 93 | return err; |
89 | } | 94 | } |
90 | default: | 95 | default: |
96 | unlock_kernel(); | ||
91 | return -ENOTTY; | 97 | return -ENOTTY; |
92 | } | 98 | } |
93 | } | 99 | } |
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c index 7edfcd4d5e52..92dde6f8d893 100644 --- a/fs/ncpfs/dir.c +++ b/fs/ncpfs/dir.c | |||
@@ -51,7 +51,7 @@ const struct file_operations ncp_dir_operations = | |||
51 | { | 51 | { |
52 | .read = generic_read_dir, | 52 | .read = generic_read_dir, |
53 | .readdir = ncp_readdir, | 53 | .readdir = ncp_readdir, |
54 | .ioctl = ncp_ioctl, | 54 | .unlocked_ioctl = ncp_ioctl, |
55 | #ifdef CONFIG_COMPAT | 55 | #ifdef CONFIG_COMPAT |
56 | .compat_ioctl = ncp_compat_ioctl, | 56 | .compat_ioctl = ncp_compat_ioctl, |
57 | #endif | 57 | #endif |
diff --git a/fs/ncpfs/file.c b/fs/ncpfs/file.c index 1daabb90e0a5..b93870892892 100644 --- a/fs/ncpfs/file.c +++ b/fs/ncpfs/file.c | |||
@@ -295,7 +295,7 @@ const struct file_operations ncp_file_operations = | |||
295 | .llseek = ncp_remote_llseek, | 295 | .llseek = ncp_remote_llseek, |
296 | .read = ncp_file_read, | 296 | .read = ncp_file_read, |
297 | .write = ncp_file_write, | 297 | .write = ncp_file_write, |
298 | .ioctl = ncp_ioctl, | 298 | .unlocked_ioctl = ncp_ioctl, |
299 | #ifdef CONFIG_COMPAT | 299 | #ifdef CONFIG_COMPAT |
300 | .compat_ioctl = ncp_compat_ioctl, | 300 | .compat_ioctl = ncp_compat_ioctl, |
301 | #endif | 301 | #endif |
diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c index 60a5e2864ea8..023c03d02070 100644 --- a/fs/ncpfs/ioctl.c +++ b/fs/ncpfs/ioctl.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/smp_lock.h> | 20 | #include <linux/smp_lock.h> |
21 | #include <linux/vmalloc.h> | 21 | #include <linux/vmalloc.h> |
22 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
23 | #include <linux/smp_lock.h> | ||
23 | 24 | ||
24 | #include <linux/ncp_fs.h> | 25 | #include <linux/ncp_fs.h> |
25 | 26 | ||
@@ -261,9 +262,9 @@ ncp_get_charsets(struct ncp_server* server, struct ncp_nls_ioctl __user *arg) | |||
261 | } | 262 | } |
262 | #endif /* CONFIG_NCPFS_NLS */ | 263 | #endif /* CONFIG_NCPFS_NLS */ |
263 | 264 | ||
264 | static int __ncp_ioctl(struct inode *inode, struct file *filp, | 265 | static long __ncp_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
265 | unsigned int cmd, unsigned long arg) | ||
266 | { | 266 | { |
267 | struct inode *inode = filp->f_dentry->d_inode; | ||
267 | struct ncp_server *server = NCP_SERVER(inode); | 268 | struct ncp_server *server = NCP_SERVER(inode); |
268 | int result; | 269 | int result; |
269 | struct ncp_ioctl_request request; | 270 | struct ncp_ioctl_request request; |
@@ -841,11 +842,11 @@ static int ncp_ioctl_need_write(unsigned int cmd) | |||
841 | } | 842 | } |
842 | } | 843 | } |
843 | 844 | ||
844 | int ncp_ioctl(struct inode *inode, struct file *filp, | 845 | long ncp_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
845 | unsigned int cmd, unsigned long arg) | ||
846 | { | 846 | { |
847 | int ret; | 847 | long ret; |
848 | 848 | ||
849 | lock_kernel(); | ||
849 | if (ncp_ioctl_need_write(cmd)) { | 850 | if (ncp_ioctl_need_write(cmd)) { |
850 | /* | 851 | /* |
851 | * inside the ioctl(), any failures which | 852 | * inside the ioctl(), any failures which |
@@ -853,24 +854,28 @@ int ncp_ioctl(struct inode *inode, struct file *filp, | |||
853 | * -EACCESS, so it seems consistent to keep | 854 | * -EACCESS, so it seems consistent to keep |
854 | * that here. | 855 | * that here. |
855 | */ | 856 | */ |
856 | if (mnt_want_write(filp->f_path.mnt)) | 857 | if (mnt_want_write(filp->f_path.mnt)) { |
857 | return -EACCES; | 858 | ret = -EACCES; |
859 | goto out; | ||
860 | } | ||
858 | } | 861 | } |
859 | ret = __ncp_ioctl(inode, filp, cmd, arg); | 862 | ret = __ncp_ioctl(filp, cmd, arg); |
860 | if (ncp_ioctl_need_write(cmd)) | 863 | if (ncp_ioctl_need_write(cmd)) |
861 | mnt_drop_write(filp->f_path.mnt); | 864 | mnt_drop_write(filp->f_path.mnt); |
865 | |||
866 | out: | ||
867 | unlock_kernel(); | ||
862 | return ret; | 868 | return ret; |
863 | } | 869 | } |
864 | 870 | ||
865 | #ifdef CONFIG_COMPAT | 871 | #ifdef CONFIG_COMPAT |
866 | long ncp_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 872 | long ncp_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
867 | { | 873 | { |
868 | struct inode *inode = file->f_path.dentry->d_inode; | 874 | long ret; |
869 | int ret; | ||
870 | 875 | ||
871 | lock_kernel(); | 876 | lock_kernel(); |
872 | arg = (unsigned long) compat_ptr(arg); | 877 | arg = (unsigned long) compat_ptr(arg); |
873 | ret = ncp_ioctl(inode, file, cmd, arg); | 878 | ret = ncp_ioctl(file, cmd, arg); |
874 | unlock_kernel(); | 879 | unlock_kernel(); |
875 | return ret; | 880 | return ret; |
876 | } | 881 | } |
diff --git a/fs/smbfs/dir.c b/fs/smbfs/dir.c index 3e4803b4427e..6c978428892d 100644 --- a/fs/smbfs/dir.c +++ b/fs/smbfs/dir.c | |||
@@ -39,7 +39,7 @@ const struct file_operations smb_dir_operations = | |||
39 | { | 39 | { |
40 | .read = generic_read_dir, | 40 | .read = generic_read_dir, |
41 | .readdir = smb_readdir, | 41 | .readdir = smb_readdir, |
42 | .ioctl = smb_ioctl, | 42 | .unlocked_ioctl = smb_ioctl, |
43 | .open = smb_dir_open, | 43 | .open = smb_dir_open, |
44 | }; | 44 | }; |
45 | 45 | ||
diff --git a/fs/smbfs/file.c b/fs/smbfs/file.c index dbf6548bbf06..84ecf0e43f91 100644 --- a/fs/smbfs/file.c +++ b/fs/smbfs/file.c | |||
@@ -437,7 +437,7 @@ const struct file_operations smb_file_operations = | |||
437 | .aio_read = smb_file_aio_read, | 437 | .aio_read = smb_file_aio_read, |
438 | .write = do_sync_write, | 438 | .write = do_sync_write, |
439 | .aio_write = smb_file_aio_write, | 439 | .aio_write = smb_file_aio_write, |
440 | .ioctl = smb_ioctl, | 440 | .unlocked_ioctl = smb_ioctl, |
441 | .mmap = smb_file_mmap, | 441 | .mmap = smb_file_mmap, |
442 | .open = smb_file_open, | 442 | .open = smb_file_open, |
443 | .release = smb_file_release, | 443 | .release = smb_file_release, |
diff --git a/fs/smbfs/ioctl.c b/fs/smbfs/ioctl.c index dbae1f8ea26f..07215312ad39 100644 --- a/fs/smbfs/ioctl.c +++ b/fs/smbfs/ioctl.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/time.h> | 13 | #include <linux/time.h> |
14 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
15 | #include <linux/highuid.h> | 15 | #include <linux/highuid.h> |
16 | #include <linux/smp_lock.h> | ||
16 | #include <linux/net.h> | 17 | #include <linux/net.h> |
17 | 18 | ||
18 | #include <linux/smb_fs.h> | 19 | #include <linux/smb_fs.h> |
@@ -22,14 +23,14 @@ | |||
22 | 23 | ||
23 | #include "proto.h" | 24 | #include "proto.h" |
24 | 25 | ||
25 | int | 26 | long |
26 | smb_ioctl(struct inode *inode, struct file *filp, | 27 | smb_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
27 | unsigned int cmd, unsigned long arg) | ||
28 | { | 28 | { |
29 | struct smb_sb_info *server = server_from_inode(inode); | 29 | struct smb_sb_info *server = server_from_inode(filp->f_path.dentry->d_inode); |
30 | struct smb_conn_opt opt; | 30 | struct smb_conn_opt opt; |
31 | int result = -EINVAL; | 31 | int result = -EINVAL; |
32 | 32 | ||
33 | lock_kernel(); | ||
33 | switch (cmd) { | 34 | switch (cmd) { |
34 | uid16_t uid16; | 35 | uid16_t uid16; |
35 | uid_t uid32; | 36 | uid_t uid32; |
@@ -62,6 +63,7 @@ smb_ioctl(struct inode *inode, struct file *filp, | |||
62 | default: | 63 | default: |
63 | break; | 64 | break; |
64 | } | 65 | } |
66 | unlock_kernel(); | ||
65 | 67 | ||
66 | return result; | 68 | return result; |
67 | } | 69 | } |
diff --git a/fs/smbfs/proto.h b/fs/smbfs/proto.h index 03f456c1b7d4..05939a6f43e6 100644 --- a/fs/smbfs/proto.h +++ b/fs/smbfs/proto.h | |||
@@ -67,7 +67,7 @@ extern const struct address_space_operations smb_file_aops; | |||
67 | extern const struct file_operations smb_file_operations; | 67 | extern const struct file_operations smb_file_operations; |
68 | extern const struct inode_operations smb_file_inode_operations; | 68 | extern const struct inode_operations smb_file_inode_operations; |
69 | /* ioctl.c */ | 69 | /* ioctl.c */ |
70 | extern int smb_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); | 70 | extern long smb_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); |
71 | /* smbiod.c */ | 71 | /* smbiod.c */ |
72 | extern void smbiod_wake_up(void); | 72 | extern void smbiod_wake_up(void); |
73 | extern int smbiod_register_server(struct smb_sb_info *server); | 73 | extern int smbiod_register_server(struct smb_sb_info *server); |