Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 28 Jul 2008 16:46:00 +0000 (09:46 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 28 Jul 2008 16:46:00 +0000 (09:46 -0700)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm:
  dlm: fix uninitialized variable for search_rsb_list callers
  dlm: release socket on error
  dlm: fix basts for granted CW waiting PR/CW
  dlm: check for null in device_write

1  2 
fs/dlm/user.c

diff --combined fs/dlm/user.c
index f976f303c196284e2426167611325772c84d4cde,1aa76b32d05690a4a0ad7000eb805799a924a3dd..929e48ae7591199cc0e6e4c80eb4516c939bfd60
@@@ -15,7 -15,6 +15,7 @@@
  #include <linux/poll.h>
  #include <linux/signal.h>
  #include <linux/spinlock.h>
 +#include <linux/smp_lock.h>
  #include <linux/dlm.h>
  #include <linux/dlm_device.h>
  
@@@ -539,7 -538,7 +539,7 @@@ static ssize_t device_write(struct fil
  
        /* do we really need this? can a write happen after a close? */
        if ((kbuf->cmd == DLM_USER_LOCK || kbuf->cmd == DLM_USER_UNLOCK) &&
-           test_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags))
+           (proc && test_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags)))
                return -EINVAL;
  
        sigfillset(&allsigs);
@@@ -619,17 -618,13 +619,17 @@@ static int device_open(struct inode *in
        struct dlm_user_proc *proc;
        struct dlm_ls *ls;
  
 +      lock_kernel();
        ls = dlm_find_lockspace_device(iminor(inode));
 -      if (!ls)
 +      if (!ls) {
 +              unlock_kernel();
                return -ENOENT;
 +      }
  
        proc = kzalloc(sizeof(struct dlm_user_proc), GFP_KERNEL);
        if (!proc) {
                dlm_put_lockspace(ls);
 +              unlock_kernel();
                return -ENOMEM;
        }
  
        spin_lock_init(&proc->locks_spin);
        init_waitqueue_head(&proc->wait);
        file->private_data = proc;
 +      unlock_kernel();
  
        return 0;
  }
@@@ -876,7 -870,6 +876,7 @@@ static unsigned int device_poll(struct 
  
  static int ctl_device_open(struct inode *inode, struct file *file)
  {
 +      cycle_kernel_lock();
        file->private_data = NULL;
        return 0;
  }