patch-1.3.4 linux/drivers/scsi/sr_ioctl.c

Next file: linux/fs/binfmt_elf.c
Previous file: linux/drivers/scsi/sg.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.3/linux/drivers/scsi/sr_ioctl.c linux/drivers/scsi/sr_ioctl.c
@@ -261,9 +261,10 @@
 			return result;
 
 		case CDROMEJECT:
-			if (scsi_CDs[target].device -> access_count == 1)
-			  sr_ioctl (inode, NULL, SCSI_IOCTL_DOORUNLOCK, 0);
+			if (scsi_CDs[target].device -> access_count != 1)
+				return -EBUSY;
 
+			sr_ioctl (inode, NULL, SCSI_IOCTL_DOORUNLOCK, 0);
 		        sr_cmd[0] = START_STOP;
 			sr_cmd[1] = ((scsi_CDs[target].device -> lun) << 5) | 1;
 			sr_cmd[2] = sr_cmd[3] = sr_cmd[5] = 0;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this