diff options
author | <axboe@suse.de> | 2005-04-12 16:22:06 -0500 |
---|---|---|
committer | James Bottomley <jejb@titanic> | 2005-04-16 20:10:09 -0500 |
commit | 152587deb8903c0edf483a5b889f975bc6bea7e0 (patch) | |
tree | 62fc13bff0a28134adbb523ed1a2c0efdd9a85cb /drivers/block/ll_rw_blk.c | |
parent | 56fece20086ebe32bce2c0d74ceadd516b56baae (diff) |
[PATCH] fix NMI lockup with CFQ scheduler
The current problem seen is that the queue lock is actually in the
SCSI device structure, so when that structure is freed on device
release, we go boom if the queue tries to access the lock again.
The fix here is to move the lock from the scsi_device to the queue.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/block/ll_rw_blk.c')
-rw-r--r-- | drivers/block/ll_rw_blk.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index 46e54b44166..11ef9d9ea13 100644 --- a/drivers/block/ll_rw_blk.c +++ b/drivers/block/ll_rw_blk.c @@ -1715,6 +1715,15 @@ request_queue_t *blk_init_queue(request_fn_proc *rfn, spinlock_t *lock) if (blk_init_free_list(q)) goto out_init; + /* + * if caller didn't supply a lock, they get per-queue locking with + * our embedded lock + */ + if (!lock) { + spin_lock_init(&q->__queue_lock); + lock = &q->__queue_lock; + } + q->request_fn = rfn; q->back_merge_fn = ll_back_merge_fn; q->front_merge_fn = ll_front_merge_fn; |