From 1813bf2a504730eb15467653476ce14e3572669b Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 20 May 2008 19:15:48 +0200 Subject: [PATCH] --- yaml --- r: 100341 b: refs/heads/master c: 514bcc66d4072a221a8dfd341a4006385a441918 h: refs/heads/master i: 100339: 01ffd91829d2b7c81d01093ba7951b3d8590deae v: v3 --- [refs] | 2 +- trunk/fs/dlm/user.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index dfccfbf1032f..6389f39f430d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 009228dfb641ca7e4315ab0d0d55465747331025 +refs/heads/master: 514bcc66d4072a221a8dfd341a4006385a441918 diff --git a/trunk/fs/dlm/user.c b/trunk/fs/dlm/user.c index ebbcf38fd33b..f976f303c196 100644 --- a/trunk/fs/dlm/user.c +++ b/trunk/fs/dlm/user.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -618,13 +619,17 @@ static int device_open(struct inode *inode, struct file *file) 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; } @@ -636,6 +641,7 @@ static int device_open(struct inode *inode, struct file *file) spin_lock_init(&proc->locks_spin); init_waitqueue_head(&proc->wait); file->private_data = proc; + unlock_kernel(); return 0; } @@ -870,6 +876,7 @@ static unsigned int device_poll(struct file *file, poll_table *wait) static int ctl_device_open(struct inode *inode, struct file *file) { + cycle_kernel_lock(); file->private_data = NULL; return 0; }