]> Pileus Git - ~andy/linux/blobdiff - fs/ocfs2/stack_user.c
[PATCH] ocfs2: Release mutex in error handling code
[~andy/linux] / fs / ocfs2 / stack_user.c
index 24e0b19c8b69bec6124d0f960d4089fc645eed0e..353fc35c6748db228172b8476c42ecac8027261c 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
 #include <linux/mutex.h>
+#include <linux/smp_lock.h>
 #include <linux/reboot.h>
 #include <asm/uaccess.h>
 
@@ -610,10 +611,12 @@ static int ocfs2_control_open(struct inode *inode, struct file *file)
                return -ENOMEM;
        p->op_this_node = -1;
 
+       lock_kernel();
        mutex_lock(&ocfs2_control_lock);
        file->private_data = p;
        list_add(&p->op_list, &ocfs2_control_private_list);
        mutex_unlock(&ocfs2_control_lock);
+       unlock_kernel();
 
        return 0;
 }