Skip to content

Commit 514bcc6

Browse files
arndbJonathan Corbet
authored andcommitted
dlm-user: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent 009228d commit 514bcc6

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎fs/dlm/user.c‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/poll.h>
1616
#include <linux/signal.h>
1717
#include <linux/spinlock.h>
18+
#include <linux/smp_lock.h>
1819
#include <linux/dlm.h>
1920
#include <linux/dlm_device.h>
2021

@@ -618,13 +619,17 @@ static int device_open(struct inode *inode, struct file *file)
618619
struct dlm_user_proc *proc;
619620
struct dlm_ls *ls;
620621

622+
lock_kernel();
621623
ls = dlm_find_lockspace_device(iminor(inode));
622-
if (!ls)
624+
if (!ls) {
625+
unlock_kernel();
623626
return -ENOENT;
627+
}
624628

625629
proc = kzalloc(sizeof(struct dlm_user_proc), GFP_KERNEL);
626630
if (!proc) {
627631
dlm_put_lockspace(ls);
632+
unlock_kernel();
628633
return -ENOMEM;
629634
}
630635

@@ -636,6 +641,7 @@ static int device_open(struct inode *inode, struct file *file)
636641
spin_lock_init(&proc->locks_spin);
637642
init_waitqueue_head(&proc->wait);
638643
file->private_data = proc;
644+
unlock_kernel();
639645

640646
return 0;
641647
}
@@ -870,6 +876,7 @@ static unsigned int device_poll(struct file *file, poll_table *wait)
870876

871877
static int ctl_device_open(struct inode *inode, struct file *file)
872878
{
879+
cycle_kernel_lock();
873880
file->private_data = NULL;
874881
return 0;
875882
}

0 commit comments

Comments
 (0)