patch-2.1.102 linux/drivers/scsi/sr.c

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

diff -u --recursive --new-file v2.1.101/linux/drivers/scsi/sr.c linux/drivers/scsi/sr.c
@@ -880,6 +880,7 @@
     unsigned char *buffer;
     int the_result, retries;
     Scsi_Cmnd * SCpnt;
+    unsigned long flags;
 
     buffer = (unsigned char *) scsi_malloc(512);
     SCpnt = scsi_allocate_device(NULL, scsi_CDs[i].device, 1);
@@ -898,10 +899,12 @@
 	{
 	    struct semaphore sem = MUTEX_LOCKED;
 	    SCpnt->request.sem = &sem;
+	    spin_lock_irqsave(&io_request_lock, flags);
 	    scsi_do_cmd (SCpnt,
 			 (void *) cmd, (void *) buffer,
 			 512, sr_init_done,  SR_TIMEOUT,
 			 MAX_RETRIES);
+	    spin_unlock_irqrestore(&io_request_lock, flags);
 	    down(&sem);
 	}
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov