patch-2.1.75 linux/drivers/scsi/sd_ioctl.c
Next file: linux/drivers/scsi/seagate.h
Previous file: linux/drivers/scsi/sd.c
Back to the patch index
Back to the overall index
- Lines: 23
- Date:
Sun Dec 21 17:04:49 1997
- Orig file:
v2.1.74/linux/drivers/scsi/sd_ioctl.c
- Orig date:
Fri Nov 29 01:20:08 1996
diff -u --recursive --new-file v2.1.74/linux/drivers/scsi/sd_ioctl.c linux/drivers/scsi/sd_ioctl.c
@@ -25,9 +25,22 @@
kdev_t dev = inode->i_rdev;
int error;
struct Scsi_Host * host;
+ Scsi_Device * SDev;
int diskinfo[4];
struct hd_geometry *loc = (struct hd_geometry *) arg;
+ SDev = rscsi_disks[MINOR(dev) >> 4].device;
+ /*
+ * If we are in the middle of error recovery, don't let anyone
+ * else try and use this device. Also, if error recovery fails, it
+ * may try and take the device offline, in which case all further
+ * access to the device is prohibited.
+ */
+ if( !scsi_block_when_processing_errors(SDev) )
+ {
+ return -ENODEV;
+ }
+
switch (cmd) {
case HDIO_GETGEO: /* Return BIOS disk parameters */
if (!loc) return -EINVAL;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov