]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'bkl/procfs' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 20 May 2010 00:23:28 +0000 (17:23 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 20 May 2010 00:23:28 +0000 (17:23 -0700)
* 'bkl/procfs' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing:
  sunrpc: Include missing smp_lock.h
  procfs: Kill the bkl in ioctl
  procfs: Push down the bkl from ioctl
  procfs: Use generic_file_llseek in /proc/vmcore
  procfs: Use generic_file_llseek in /proc/kmsg
  procfs: Use generic_file_llseek in /proc/kcore
  procfs: Kill BKL in llseek on proc base

1  2 
drivers/isdn/divert/divert_procfs.c
fs/proc/base.c
fs/proc/inode.c
fs/proc/kcore.c
fs/proc/vmcore.c

index 9f49d906579177430c463d03f78dbe514237def5,724693c4d975e8a41deab965a83a39e213252790..c53e2417e7d4aca7130160d27dbf4b32815c1e1d
@@@ -11,7 -11,6 +11,7 @@@
  
  #include <linux/module.h>
  #include <linux/poll.h>
 +#include <linux/slab.h>
  #ifdef CONFIG_PROC_FS
  #include <linux/proc_fs.h>
  #else
@@@ -20,6 -19,7 +20,7 @@@
  #include <linux/sched.h>
  #include <linux/isdnif.h>
  #include <net/net_namespace.h>
+ #include <linux/smp_lock.h>
  #include "isdn_divert.h"
  
  
@@@ -177,9 -177,7 +178,7 @@@ isdn_divert_close(struct inode *ino, st
  /*********/
  /* IOCTL */
  /*********/
- static int
- isdn_divert_ioctl(struct inode *inode, struct file *file,
-                 uint cmd, ulong arg)
+ static int isdn_divert_ioctl_unlocked(struct file *file, uint cmd, ulong arg)
  {
        divert_ioctl dioctl;
        int i;
        return copy_to_user((void __user *)arg, &dioctl, sizeof(dioctl)) ? -EFAULT : 0;
  }                             /* isdn_divert_ioctl */
  
+ static long isdn_divert_ioctl(struct file *file, uint cmd, ulong arg)
+ {
+       long ret;
+       lock_kernel();
+       ret = isdn_divert_ioctl_unlocked(file, cmd, arg);
+       unlock_kernel();
+       return ret;
+ }
  static const struct file_operations isdn_fops =
  {
        .owner          = THIS_MODULE,
        .read           = isdn_divert_read,
        .write          = isdn_divert_write,
        .poll           = isdn_divert_poll,
-       .ioctl          = isdn_divert_ioctl,
+       .unlocked_ioctl = isdn_divert_ioctl,
        .open           = isdn_divert_open,
        .release        = isdn_divert_close,                                      
  };
diff --combined fs/proc/base.c
index 8418fcc0a6abd1efb58c0c66efdb1fef411d81d8,95d91cf3e24c573a664a29f4ec1f9bd03c9f2b2b..c7f9f23449dc402a16ff1b36eb817fe63f02a779
@@@ -81,7 -81,6 +81,7 @@@
  #include <linux/elf.h>
  #include <linux/pid_namespace.h>
  #include <linux/fs_struct.h>
 +#include <linux/slab.h>
  #include "internal.h"
  
  /* NOTE:
@@@ -443,13 -442,12 +443,13 @@@ static const struct file_operations pro
  unsigned long badness(struct task_struct *p, unsigned long uptime);
  static int proc_oom_score(struct task_struct *task, char *buffer)
  {
 -      unsigned long points;
 +      unsigned long points = 0;
        struct timespec uptime;
  
        do_posix_clock_monotonic_gettime(&uptime);
        read_lock(&tasklist_lock);
 -      points = badness(task->group_leader, uptime.tv_sec);
 +      if (pid_alive(task))
 +              points = badness(task, uptime.tv_sec);
        read_unlock(&tasklist_lock);
        return sprintf(buffer, "%lu\n", points);
  }
@@@ -730,6 -728,7 +730,7 @@@ out_no_task
  
  static const struct file_operations proc_info_file_operations = {
        .read           = proc_info_read,
+       .llseek         = generic_file_llseek,
  };
  
  static int proc_single_show(struct seq_file *m, void *v)
@@@ -987,6 -986,7 +988,7 @@@ out_no_task
  
  static const struct file_operations proc_environ_operations = {
        .read           = environ_read,
+       .llseek         = generic_file_llseek,
  };
  
  static ssize_t oom_adjust_read(struct file *file, char __user *buf,
@@@ -1060,6 -1060,7 +1062,7 @@@ static ssize_t oom_adjust_write(struct 
  static const struct file_operations proc_oom_adjust_operations = {
        .read           = oom_adjust_read,
        .write          = oom_adjust_write,
+       .llseek         = generic_file_llseek,
  };
  
  #ifdef CONFIG_AUDITSYSCALL
@@@ -1131,6 -1132,7 +1134,7 @@@ out_free_page
  static const struct file_operations proc_loginuid_operations = {
        .read           = proc_loginuid_read,
        .write          = proc_loginuid_write,
+       .llseek         = generic_file_llseek,
  };
  
  static ssize_t proc_sessionid_read(struct file * file, char __user * buf,
  
  static const struct file_operations proc_sessionid_operations = {
        .read           = proc_sessionid_read,
+       .llseek         = generic_file_llseek,
  };
  #endif
  
@@@ -1202,6 -1205,7 +1207,7 @@@ static ssize_t proc_fault_inject_write(
  static const struct file_operations proc_fault_inject_operations = {
        .read           = proc_fault_inject_read,
        .write          = proc_fault_inject_write,
+       .llseek         = generic_file_llseek,
  };
  #endif
  
@@@ -1943,7 -1947,7 +1949,7 @@@ static ssize_t proc_fdinfo_read(struct 
  }
  
  static const struct file_operations proc_fdinfo_file_operations = {
-       .open           = nonseekable_open,
+       .open           = nonseekable_open,
        .read           = proc_fdinfo_read,
  };
  
@@@ -2227,6 -2231,7 +2233,7 @@@ out_no_task
  static const struct file_operations proc_pid_attr_operations = {
        .read           = proc_pid_attr_read,
        .write          = proc_pid_attr_write,
+       .llseek         = generic_file_llseek,
  };
  
  static const struct pid_entry attr_dir_stuff[] = {
@@@ -2347,6 -2352,7 +2354,7 @@@ static ssize_t proc_coredump_filter_wri
  static const struct file_operations proc_coredump_filter_operations = {
        .read           = proc_coredump_filter_read,
        .write          = proc_coredump_filter_write,
+       .llseek         = generic_file_llseek,
  };
  #endif
  
@@@ -2909,7 -2915,7 +2917,7 @@@ out_no_task
   */
  static const struct pid_entry tid_base_stuff[] = {
        DIR("fd",        S_IRUSR|S_IXUSR, proc_fd_inode_operations, proc_fd_operations),
 -      DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fd_operations),
 +      DIR("fdinfo",    S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fdinfo_operations),
        REG("environ",   S_IRUSR, proc_environ_operations),
        INF("auxv",      S_IRUSR, proc_pid_auxv),
        ONE("status",    S_IRUGO, proc_pid_status),
diff --combined fs/proc/inode.c
index d35b23238fb1902416ff953f87c9edd2a636899c,afcda8588e1cf28d285cbf24b8eddea564de4e75..aea8502e58a3a247aae6c4ea5a85e99c7da36b03
@@@ -18,7 -18,6 +18,7 @@@
  #include <linux/module.h>
  #include <linux/smp_lock.h>
  #include <linux/sysctl.h>
 +#include <linux/slab.h>
  
  #include <asm/system.h>
  #include <asm/uaccess.h>
@@@ -232,9 -231,9 +232,9 @@@ static long proc_reg_unlocked_ioctl(str
                if (rv == -ENOIOCTLCMD)
                        rv = -EINVAL;
        } else if (ioctl) {
-               lock_kernel();
+               WARN_ONCE(1, "Procfs ioctl handlers must use unlocked_ioctl, "
+                         "%pf will be called without the Bkl held\n", ioctl);
                rv = ioctl(file->f_path.dentry->d_inode, file, cmd, arg);
-               unlock_kernel();
        }
  
        pde_users_dec(pde);
diff --combined fs/proc/kcore.c
index 19979a2ce27204d1851c96bc3126fd201a68651f,396453200ef41516e89f3f0b0729991c5abdc71e..c837a77351beb933e8c8f4d2a7e356fcfb48b823
@@@ -19,7 -19,6 +19,7 @@@
  #include <linux/highmem.h>
  #include <linux/bootmem.h>
  #include <linux/init.h>
 +#include <linux/slab.h>
  #include <asm/uaccess.h>
  #include <asm/io.h>
  #include <linux/list.h>
@@@ -558,6 -557,7 +558,7 @@@ static int open_kcore(struct inode *ino
  static const struct file_operations proc_kcore_operations = {
        .read           = read_kcore,
        .open           = open_kcore,
+       .llseek         = generic_file_llseek,
  };
  
  #ifdef CONFIG_MEMORY_HOTPLUG
diff --combined fs/proc/vmcore.c
index 9fbc99ec799a5636e455cc1982b5196ad3096690,00ef6046d8d2c395028f23af338f160eff04cd68..91c817ff02c3847a874e1e99f7638b1148869a77
@@@ -12,7 -12,6 +12,7 @@@
  #include <linux/user.h>
  #include <linux/elf.h>
  #include <linux/elfcore.h>
 +#include <linux/slab.h>
  #include <linux/highmem.h>
  #include <linux/bootmem.h>
  #include <linux/init.h>
@@@ -163,6 -162,7 +163,7 @@@ static ssize_t read_vmcore(struct file 
  
  static const struct file_operations proc_vmcore_operations = {
        .read           = read_vmcore,
+       .llseek         = generic_file_llseek,
  };
  
  static struct vmcore* __init get_new_element(void)