patch-2.3.40 linux/drivers/scsi/scsi_queue.c

Next file: linux/drivers/scsi/sd.c
Previous file: linux/drivers/scsi/scsi_lib.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.39/linux/drivers/scsi/scsi_queue.c linux/drivers/scsi/scsi_queue.c
@@ -79,6 +79,7 @@
 int scsi_mlqueue_insert(Scsi_Cmnd * cmd, int reason)
 {
 	struct Scsi_Host *host;
+	unsigned long flags;
 
 	SCSI_LOG_MLQUEUE(1, printk("Inserting command %p into mlqueue\n", cmd));
 
@@ -136,8 +137,10 @@
 	 * Decrement the counters, since these commands are no longer
 	 * active on the host/device.
 	 */
+	spin_lock_irqsave(&io_request_lock, flags);
 	cmd->host->host_busy--;
 	cmd->device->device_busy--;
+	spin_unlock_irqrestore(&io_request_lock, flags);
 
 	/*
 	 * Insert this command at the head of the queue for it's device.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)