patch-2.1.106 linux/drivers/scsi/sr_ioctl.c
Next file: linux/drivers/sound/Config.in
Previous file: linux/drivers/scsi/scsi_proc.c
Back to the patch index
Back to the overall index
-  Lines: 15
-  Date:
Fri Jun 12 22:31:48 1998
-  Orig file: 
v2.1.105/linux/drivers/scsi/sr_ioctl.c
-  Orig date: 
Thu May 14 19:47:41 1998
diff -u --recursive --new-file v2.1.105/linux/drivers/scsi/sr_ioctl.c linux/drivers/scsi/sr_ioctl.c
@@ -93,7 +93,14 @@
                     printk(KERN_INFO "sr%d: CDROM not ready yet.\n", target);
 		if (retries++ < 10) {
 		    /* sleep 2 sec and try again */
+		    /*
+		     * The spinlock is silly - we should really lock more of this
+		     * function, but the minimal locking required to not lock up
+		     * is around this - scsi_sleep() assumes we hold the spinlock.
+		     */
+		    spin_lock_irqsave(&io_request_lock, flags);
 		    scsi_sleep(2*HZ);
+		    spin_unlock_irqrestore(&io_request_lock, flags);
                     goto retry;
 		} else {
 		    /* 20 secs are enouth? */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov