Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100341
b: refs/heads/master
c: 514bcc6
h: refs/heads/master
i:
  100339: 01ffd91
v: v3
  • Loading branch information
Arnd Bergmann authored and Jonathan Corbet committed Jun 20, 2008
1 parent 0ecb874 commit 1813bf2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 009228dfb641ca7e4315ab0d0d55465747331025
refs/heads/master: 514bcc66d4072a221a8dfd341a4006385a441918
9 changes: 8 additions & 1 deletion trunk/fs/dlm/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 1813bf2

Please sign in to comment.