Commit ce8273a573918612cbd320597db3d5dd89578454
Committed by
Frederic Weisbecker
1 parent
977183902a
Exists in
master
and in
7 other branches
smbfs: Push down BKL into ioctl function
Converting from ->ioctl to ->unlocked_ioctl with explicit lock_kernel lets us kill the ioctl operation. Signed-off-by: Arnd Bergmann <arnd@arndb.de> [fixed inode reference in smb_ioctl] Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Showing 4 changed files with 9 additions and 7 deletions Side-by-side Diff
fs/smbfs/dir.c
fs/smbfs/file.c
fs/smbfs/ioctl.c
... | ... | @@ -13,6 +13,7 @@ |
13 | 13 | #include <linux/time.h> |
14 | 14 | #include <linux/mm.h> |
15 | 15 | #include <linux/highuid.h> |
16 | +#include <linux/smp_lock.h> | |
16 | 17 | #include <linux/net.h> |
17 | 18 | |
18 | 19 | #include <linux/smb_fs.h> |
19 | 20 | |
20 | 21 | |
... | ... | @@ -22,14 +23,14 @@ |
22 | 23 | |
23 | 24 | #include "proto.h" |
24 | 25 | |
25 | -int | |
26 | -smb_ioctl(struct inode *inode, struct file *filp, | |
27 | - unsigned int cmd, unsigned long arg) | |
26 | +long | |
27 | +smb_ioctl(struct file *filp, 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 | 30 | struct smb_conn_opt opt; |
31 | 31 | int result = -EINVAL; |
32 | 32 | |
33 | + lock_kernel(); | |
33 | 34 | switch (cmd) { |
34 | 35 | uid16_t uid16; |
35 | 36 | uid_t uid32; |
... | ... | @@ -62,6 +63,7 @@ |
62 | 63 | default: |
63 | 64 | break; |
64 | 65 | } |
66 | + unlock_kernel(); | |
65 | 67 | |
66 | 68 | return result; |
67 | 69 | } |
fs/smbfs/proto.h
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 | extern const struct file_operations smb_file_operations; |
68 | 68 | extern const struct inode_operations smb_file_inode_operations; |
69 | 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 | 71 | /* smbiod.c */ |
72 | 72 | extern void smbiod_wake_up(void); |
73 | 73 | extern int smbiod_register_server(struct smb_sb_info *server); |