diff options
-rw-r--r-- | drivers/char/i8k.c | 21 | ||||
-rw-r--r-- | drivers/isdn/divert/divert_procfs.c | 18 | ||||
-rw-r--r-- | fs/proc/base.c | 10 | ||||
-rw-r--r-- | fs/proc/inode.c | 4 | ||||
-rw-r--r-- | fs/proc/kcore.c | 1 | ||||
-rw-r--r-- | fs/proc/kmsg.c | 1 | ||||
-rw-r--r-- | fs/proc/vmcore.c | 1 | ||||
-rw-r--r-- | net/sunrpc/cache.c | 15 |
8 files changed, 55 insertions, 16 deletions
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c index fc8cf7ac7f2b..4cd8b227c11f 100644 --- a/drivers/char/i8k.c +++ b/drivers/char/i8k.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/seq_file.h> | 23 | #include <linux/seq_file.h> |
24 | #include <linux/dmi.h> | 24 | #include <linux/dmi.h> |
25 | #include <linux/capability.h> | 25 | #include <linux/capability.h> |
26 | #include <linux/smp_lock.h> | ||
26 | #include <asm/uaccess.h> | 27 | #include <asm/uaccess.h> |
27 | #include <asm/io.h> | 28 | #include <asm/io.h> |
28 | 29 | ||
@@ -82,8 +83,7 @@ module_param(fan_mult, int, 0); | |||
82 | MODULE_PARM_DESC(fan_mult, "Factor to multiply fan speed with"); | 83 | MODULE_PARM_DESC(fan_mult, "Factor to multiply fan speed with"); |
83 | 84 | ||
84 | static int i8k_open_fs(struct inode *inode, struct file *file); | 85 | static int i8k_open_fs(struct inode *inode, struct file *file); |
85 | static int i8k_ioctl(struct inode *, struct file *, unsigned int, | 86 | static long i8k_ioctl(struct file *, unsigned int, unsigned long); |
86 | unsigned long); | ||
87 | 87 | ||
88 | static const struct file_operations i8k_fops = { | 88 | static const struct file_operations i8k_fops = { |
89 | .owner = THIS_MODULE, | 89 | .owner = THIS_MODULE, |
@@ -91,7 +91,7 @@ static const struct file_operations i8k_fops = { | |||
91 | .read = seq_read, | 91 | .read = seq_read, |
92 | .llseek = seq_lseek, | 92 | .llseek = seq_lseek, |
93 | .release = single_release, | 93 | .release = single_release, |
94 | .ioctl = i8k_ioctl, | 94 | .unlocked_ioctl = i8k_ioctl, |
95 | }; | 95 | }; |
96 | 96 | ||
97 | struct smm_regs { | 97 | struct smm_regs { |
@@ -307,8 +307,8 @@ static int i8k_get_dell_signature(int req_fn) | |||
307 | return regs.eax == 1145651527 && regs.edx == 1145392204 ? 0 : -1; | 307 | return regs.eax == 1145651527 && regs.edx == 1145392204 ? 0 : -1; |
308 | } | 308 | } |
309 | 309 | ||
310 | static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, | 310 | static int |
311 | unsigned long arg) | 311 | i8k_ioctl_unlocked(struct file *fp, unsigned int cmd, unsigned long arg) |
312 | { | 312 | { |
313 | int val = 0; | 313 | int val = 0; |
314 | int speed; | 314 | int speed; |
@@ -395,6 +395,17 @@ static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, | |||
395 | return 0; | 395 | return 0; |
396 | } | 396 | } |
397 | 397 | ||
398 | static long i8k_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) | ||
399 | { | ||
400 | long ret; | ||
401 | |||
402 | lock_kernel(); | ||
403 | ret = i8k_ioctl_unlocked(fp, cmd, arg); | ||
404 | unlock_kernel(); | ||
405 | |||
406 | return ret; | ||
407 | } | ||
408 | |||
398 | /* | 409 | /* |
399 | * Print the information for /proc/i8k. | 410 | * Print the information for /proc/i8k. |
400 | */ | 411 | */ |
diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c index 9f49d9065791..c53e2417e7d4 100644 --- a/drivers/isdn/divert/divert_procfs.c +++ b/drivers/isdn/divert/divert_procfs.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
21 | #include <linux/isdnif.h> | 21 | #include <linux/isdnif.h> |
22 | #include <net/net_namespace.h> | 22 | #include <net/net_namespace.h> |
23 | #include <linux/smp_lock.h> | ||
23 | #include "isdn_divert.h" | 24 | #include "isdn_divert.h" |
24 | 25 | ||
25 | 26 | ||
@@ -177,9 +178,7 @@ isdn_divert_close(struct inode *ino, struct file *filep) | |||
177 | /*********/ | 178 | /*********/ |
178 | /* IOCTL */ | 179 | /* IOCTL */ |
179 | /*********/ | 180 | /*********/ |
180 | static int | 181 | static int isdn_divert_ioctl_unlocked(struct file *file, uint cmd, ulong arg) |
181 | isdn_divert_ioctl(struct inode *inode, struct file *file, | ||
182 | uint cmd, ulong arg) | ||
183 | { | 182 | { |
184 | divert_ioctl dioctl; | 183 | divert_ioctl dioctl; |
185 | int i; | 184 | int i; |
@@ -258,6 +257,17 @@ isdn_divert_ioctl(struct inode *inode, struct file *file, | |||
258 | return copy_to_user((void __user *)arg, &dioctl, sizeof(dioctl)) ? -EFAULT : 0; | 257 | return copy_to_user((void __user *)arg, &dioctl, sizeof(dioctl)) ? -EFAULT : 0; |
259 | } /* isdn_divert_ioctl */ | 258 | } /* isdn_divert_ioctl */ |
260 | 259 | ||
260 | static long isdn_divert_ioctl(struct file *file, uint cmd, ulong arg) | ||
261 | { | ||
262 | long ret; | ||
263 | |||
264 | lock_kernel(); | ||
265 | ret = isdn_divert_ioctl_unlocked(file, cmd, arg); | ||
266 | unlock_kernel(); | ||
267 | |||
268 | return ret; | ||
269 | } | ||
270 | |||
261 | static const struct file_operations isdn_fops = | 271 | static const struct file_operations isdn_fops = |
262 | { | 272 | { |
263 | .owner = THIS_MODULE, | 273 | .owner = THIS_MODULE, |
@@ -265,7 +275,7 @@ static const struct file_operations isdn_fops = | |||
265 | .read = isdn_divert_read, | 275 | .read = isdn_divert_read, |
266 | .write = isdn_divert_write, | 276 | .write = isdn_divert_write, |
267 | .poll = isdn_divert_poll, | 277 | .poll = isdn_divert_poll, |
268 | .ioctl = isdn_divert_ioctl, | 278 | .unlocked_ioctl = isdn_divert_ioctl, |
269 | .open = isdn_divert_open, | 279 | .open = isdn_divert_open, |
270 | .release = isdn_divert_close, | 280 | .release = isdn_divert_close, |
271 | }; | 281 | }; |
diff --git a/fs/proc/base.c b/fs/proc/base.c index 8418fcc0a6ab..c7f9f23449dc 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -730,6 +730,7 @@ out_no_task: | |||
730 | 730 | ||
731 | static const struct file_operations proc_info_file_operations = { | 731 | static const struct file_operations proc_info_file_operations = { |
732 | .read = proc_info_read, | 732 | .read = proc_info_read, |
733 | .llseek = generic_file_llseek, | ||
733 | }; | 734 | }; |
734 | 735 | ||
735 | static int proc_single_show(struct seq_file *m, void *v) | 736 | static int proc_single_show(struct seq_file *m, void *v) |
@@ -987,6 +988,7 @@ out_no_task: | |||
987 | 988 | ||
988 | static const struct file_operations proc_environ_operations = { | 989 | static const struct file_operations proc_environ_operations = { |
989 | .read = environ_read, | 990 | .read = environ_read, |
991 | .llseek = generic_file_llseek, | ||
990 | }; | 992 | }; |
991 | 993 | ||
992 | static ssize_t oom_adjust_read(struct file *file, char __user *buf, | 994 | static ssize_t oom_adjust_read(struct file *file, char __user *buf, |
@@ -1060,6 +1062,7 @@ static ssize_t oom_adjust_write(struct file *file, const char __user *buf, | |||
1060 | static const struct file_operations proc_oom_adjust_operations = { | 1062 | static const struct file_operations proc_oom_adjust_operations = { |
1061 | .read = oom_adjust_read, | 1063 | .read = oom_adjust_read, |
1062 | .write = oom_adjust_write, | 1064 | .write = oom_adjust_write, |
1065 | .llseek = generic_file_llseek, | ||
1063 | }; | 1066 | }; |
1064 | 1067 | ||
1065 | #ifdef CONFIG_AUDITSYSCALL | 1068 | #ifdef CONFIG_AUDITSYSCALL |
@@ -1131,6 +1134,7 @@ out_free_page: | |||
1131 | static const struct file_operations proc_loginuid_operations = { | 1134 | static const struct file_operations proc_loginuid_operations = { |
1132 | .read = proc_loginuid_read, | 1135 | .read = proc_loginuid_read, |
1133 | .write = proc_loginuid_write, | 1136 | .write = proc_loginuid_write, |
1137 | .llseek = generic_file_llseek, | ||
1134 | }; | 1138 | }; |
1135 | 1139 | ||
1136 | static ssize_t proc_sessionid_read(struct file * file, char __user * buf, | 1140 | static ssize_t proc_sessionid_read(struct file * file, char __user * buf, |
@@ -1151,6 +1155,7 @@ static ssize_t proc_sessionid_read(struct file * file, char __user * buf, | |||
1151 | 1155 | ||
1152 | static const struct file_operations proc_sessionid_operations = { | 1156 | static const struct file_operations proc_sessionid_operations = { |
1153 | .read = proc_sessionid_read, | 1157 | .read = proc_sessionid_read, |
1158 | .llseek = generic_file_llseek, | ||
1154 | }; | 1159 | }; |
1155 | #endif | 1160 | #endif |
1156 | 1161 | ||
@@ -1202,6 +1207,7 @@ static ssize_t proc_fault_inject_write(struct file * file, | |||
1202 | static const struct file_operations proc_fault_inject_operations = { | 1207 | static const struct file_operations proc_fault_inject_operations = { |
1203 | .read = proc_fault_inject_read, | 1208 | .read = proc_fault_inject_read, |
1204 | .write = proc_fault_inject_write, | 1209 | .write = proc_fault_inject_write, |
1210 | .llseek = generic_file_llseek, | ||
1205 | }; | 1211 | }; |
1206 | #endif | 1212 | #endif |
1207 | 1213 | ||
@@ -1943,7 +1949,7 @@ static ssize_t proc_fdinfo_read(struct file *file, char __user *buf, | |||
1943 | } | 1949 | } |
1944 | 1950 | ||
1945 | static const struct file_operations proc_fdinfo_file_operations = { | 1951 | static const struct file_operations proc_fdinfo_file_operations = { |
1946 | .open = nonseekable_open, | 1952 | .open = nonseekable_open, |
1947 | .read = proc_fdinfo_read, | 1953 | .read = proc_fdinfo_read, |
1948 | }; | 1954 | }; |
1949 | 1955 | ||
@@ -2227,6 +2233,7 @@ out_no_task: | |||
2227 | static const struct file_operations proc_pid_attr_operations = { | 2233 | static const struct file_operations proc_pid_attr_operations = { |
2228 | .read = proc_pid_attr_read, | 2234 | .read = proc_pid_attr_read, |
2229 | .write = proc_pid_attr_write, | 2235 | .write = proc_pid_attr_write, |
2236 | .llseek = generic_file_llseek, | ||
2230 | }; | 2237 | }; |
2231 | 2238 | ||
2232 | static const struct pid_entry attr_dir_stuff[] = { | 2239 | static const struct pid_entry attr_dir_stuff[] = { |
@@ -2347,6 +2354,7 @@ static ssize_t proc_coredump_filter_write(struct file *file, | |||
2347 | static const struct file_operations proc_coredump_filter_operations = { | 2354 | static const struct file_operations proc_coredump_filter_operations = { |
2348 | .read = proc_coredump_filter_read, | 2355 | .read = proc_coredump_filter_read, |
2349 | .write = proc_coredump_filter_write, | 2356 | .write = proc_coredump_filter_write, |
2357 | .llseek = generic_file_llseek, | ||
2350 | }; | 2358 | }; |
2351 | #endif | 2359 | #endif |
2352 | 2360 | ||
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index d35b23238fb1..aea8502e58a3 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c | |||
@@ -232,9 +232,9 @@ static long proc_reg_unlocked_ioctl(struct file *file, unsigned int cmd, unsigne | |||
232 | if (rv == -ENOIOCTLCMD) | 232 | if (rv == -ENOIOCTLCMD) |
233 | rv = -EINVAL; | 233 | rv = -EINVAL; |
234 | } else if (ioctl) { | 234 | } else if (ioctl) { |
235 | lock_kernel(); | 235 | WARN_ONCE(1, "Procfs ioctl handlers must use unlocked_ioctl, " |
236 | "%pf will be called without the Bkl held\n", ioctl); | ||
236 | rv = ioctl(file->f_path.dentry->d_inode, file, cmd, arg); | 237 | rv = ioctl(file->f_path.dentry->d_inode, file, cmd, arg); |
237 | unlock_kernel(); | ||
238 | } | 238 | } |
239 | 239 | ||
240 | pde_users_dec(pde); | 240 | pde_users_dec(pde); |
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 19979a2ce272..c837a77351be 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c | |||
@@ -558,6 +558,7 @@ static int open_kcore(struct inode *inode, struct file *filp) | |||
558 | static const struct file_operations proc_kcore_operations = { | 558 | static const struct file_operations proc_kcore_operations = { |
559 | .read = read_kcore, | 559 | .read = read_kcore, |
560 | .open = open_kcore, | 560 | .open = open_kcore, |
561 | .llseek = generic_file_llseek, | ||
561 | }; | 562 | }; |
562 | 563 | ||
563 | #ifdef CONFIG_MEMORY_HOTPLUG | 564 | #ifdef CONFIG_MEMORY_HOTPLUG |
diff --git a/fs/proc/kmsg.c b/fs/proc/kmsg.c index cfe90a48a6e8..bd4b5a740ff1 100644 --- a/fs/proc/kmsg.c +++ b/fs/proc/kmsg.c | |||
@@ -53,6 +53,7 @@ static const struct file_operations proc_kmsg_operations = { | |||
53 | .poll = kmsg_poll, | 53 | .poll = kmsg_poll, |
54 | .open = kmsg_open, | 54 | .open = kmsg_open, |
55 | .release = kmsg_release, | 55 | .release = kmsg_release, |
56 | .llseek = generic_file_llseek, | ||
56 | }; | 57 | }; |
57 | 58 | ||
58 | static int __init proc_kmsg_init(void) | 59 | static int __init proc_kmsg_init(void) |
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c index 9fbc99ec799a..91c817ff02c3 100644 --- a/fs/proc/vmcore.c +++ b/fs/proc/vmcore.c | |||
@@ -163,6 +163,7 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer, | |||
163 | 163 | ||
164 | static const struct file_operations proc_vmcore_operations = { | 164 | static const struct file_operations proc_vmcore_operations = { |
165 | .read = read_vmcore, | 165 | .read = read_vmcore, |
166 | .llseek = generic_file_llseek, | ||
166 | }; | 167 | }; |
167 | 168 | ||
168 | static struct vmcore* __init get_new_element(void) | 169 | static struct vmcore* __init get_new_element(void) |
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index 39bddba53ba1..77970fe8bff2 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/workqueue.h> | 28 | #include <linux/workqueue.h> |
29 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
30 | #include <linux/pagemap.h> | 30 | #include <linux/pagemap.h> |
31 | #include <linux/smp_lock.h> | ||
31 | #include <asm/ioctls.h> | 32 | #include <asm/ioctls.h> |
32 | #include <linux/sunrpc/types.h> | 33 | #include <linux/sunrpc/types.h> |
33 | #include <linux/sunrpc/cache.h> | 34 | #include <linux/sunrpc/cache.h> |
@@ -1331,12 +1332,18 @@ static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait) | |||
1331 | return cache_poll(filp, wait, cd); | 1332 | return cache_poll(filp, wait, cd); |
1332 | } | 1333 | } |
1333 | 1334 | ||
1334 | static int cache_ioctl_procfs(struct inode *inode, struct file *filp, | 1335 | static long cache_ioctl_procfs(struct file *filp, |
1335 | unsigned int cmd, unsigned long arg) | 1336 | unsigned int cmd, unsigned long arg) |
1336 | { | 1337 | { |
1338 | long ret; | ||
1339 | struct inode *inode = filp->f_path.dentry->d_inode; | ||
1337 | struct cache_detail *cd = PDE(inode)->data; | 1340 | struct cache_detail *cd = PDE(inode)->data; |
1338 | 1341 | ||
1339 | return cache_ioctl(inode, filp, cmd, arg, cd); | 1342 | lock_kernel(); |
1343 | ret = cache_ioctl(inode, filp, cmd, arg, cd); | ||
1344 | unlock_kernel(); | ||
1345 | |||
1346 | return ret; | ||
1340 | } | 1347 | } |
1341 | 1348 | ||
1342 | static int cache_open_procfs(struct inode *inode, struct file *filp) | 1349 | static int cache_open_procfs(struct inode *inode, struct file *filp) |
@@ -1359,7 +1366,7 @@ static const struct file_operations cache_file_operations_procfs = { | |||
1359 | .read = cache_read_procfs, | 1366 | .read = cache_read_procfs, |
1360 | .write = cache_write_procfs, | 1367 | .write = cache_write_procfs, |
1361 | .poll = cache_poll_procfs, | 1368 | .poll = cache_poll_procfs, |
1362 | .ioctl = cache_ioctl_procfs, /* for FIONREAD */ | 1369 | .unlocked_ioctl = cache_ioctl_procfs, /* for FIONREAD */ |
1363 | .open = cache_open_procfs, | 1370 | .open = cache_open_procfs, |
1364 | .release = cache_release_procfs, | 1371 | .release = cache_release_procfs, |
1365 | }; | 1372 | }; |