Commit b0061a0e authored by Jonathan Corbet's avatar Jonathan Corbet

changer: BKL pushdown

Add lock_kernel() calls to ch_open(), though the existing locking looks
adequate.
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent dea3f665
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/chio.h> /* here are all the ioctls */ #include <linux/chio.h> /* here are all the ioctls */
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/idr.h> #include <linux/idr.h>
#include <linux/smp_lock.h>
#include <scsi/scsi.h> #include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h> #include <scsi/scsi_cmnd.h>
...@@ -571,16 +572,19 @@ ch_open(struct inode *inode, struct file *file) ...@@ -571,16 +572,19 @@ ch_open(struct inode *inode, struct file *file)
scsi_changer *ch; scsi_changer *ch;
int minor = iminor(inode); int minor = iminor(inode);
lock_kernel();
spin_lock(&ch_index_lock); spin_lock(&ch_index_lock);
ch = idr_find(&ch_index_idr, minor); ch = idr_find(&ch_index_idr, minor);
if (NULL == ch || scsi_device_get(ch->device)) { if (NULL == ch || scsi_device_get(ch->device)) {
spin_unlock(&ch_index_lock); spin_unlock(&ch_index_lock);
unlock_kernel();
return -ENXIO; return -ENXIO;
} }
spin_unlock(&ch_index_lock); spin_unlock(&ch_index_lock);
file->private_data = ch; file->private_data = ch;
unlock_kernel();
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment