From: Linus Torvalds Date: Mon, 28 Jul 2008 16:46:00 +0000 (-0700) Subject: Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm X-Git-Tag: v2.6.27-rc1~26 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=3988ba0708e98b4bafc9034aa476775520bee708;hp=-c Merge branch 'for-linus' of git://git./linux/kernel/git/teigland/dlm * '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 --- 3988ba0708e98b4bafc9034aa476775520bee708 diff --combined fs/dlm/user.c index f976f303c196,1aa76b32d056..929e48ae7591 --- a/fs/dlm/user.c +++ b/fs/dlm/user.c @@@ -15,7 -15,6 +15,7 @@@ #include #include #include +#include #include #include @@@ -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; } @@@ -641,7 -636,6 +641,7 @@@ 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; }