[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>
This commit is contained in:
2005-04-12 16:22:06 -05:00
committed by James Bottomley
parent 56fece2008
commit 152587deb8
5 changed files with 16 additions and 6 deletions

View File

@@ -360,9 +360,9 @@ void scsi_device_unbusy(struct scsi_device *sdev)
shost->host_failed))
scsi_eh_wakeup(shost);
spin_unlock(shost->host_lock);
spin_lock(&sdev->sdev_lock);
spin_lock(sdev->request_queue->queue_lock);
sdev->device_busy--;
spin_unlock_irqrestore(&sdev->sdev_lock, flags);
spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags);
}
/*
@@ -1425,7 +1425,7 @@ struct request_queue *scsi_alloc_queue(struct scsi_device *sdev)
struct Scsi_Host *shost = sdev->host;
struct request_queue *q;
q = blk_init_queue(scsi_request_fn, &sdev->sdev_lock);
q = blk_init_queue(scsi_request_fn, NULL);
if (!q)
return NULL;