summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sg.c
diff options
context:
space:
mode:
authorJames Bottomley2005-09-18 22:05:20 +0200
committerJames Bottomley2005-09-19 16:24:52 +0200
commit939647ee308e0ad924e776657704c7bedd498664 (patch)
treecfff68b8f65a53e186fd1e7443aa370885ac1ed9 /drivers/scsi/sg.c
parent[SCSI] SCSI scanning and removal fixes (diff)
downloadkernel-qcow2-linux-939647ee308e0ad924e776657704c7bedd498664.tar.gz
kernel-qcow2-linux-939647ee308e0ad924e776657704c7bedd498664.tar.xz
kernel-qcow2-linux-939647ee308e0ad924e776657704c7bedd498664.zip
[SCSI] fix oops on usb storage device disconnect
We fix the oops by enforcing the host state model. There have also been two extra states added: SHOST_CANCEL_RECOVERY and SHOST_DEL_RECOVERY so we can take the model through host removal while the recovery thread is active. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r--drivers/scsi/sg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 9ea4765d1d12..4d09a6e4dd2e 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1027,7 +1027,7 @@ sg_ioctl(struct inode *inode, struct file *filp,
if (sdp->detached)
return -ENODEV;
if (filp->f_flags & O_NONBLOCK) {
- if (sdp->device->host->shost_state == SHOST_RECOVERY)
+ if (scsi_host_in_recovery(sdp->device->host))
return -EBUSY;
} else if (!scsi_block_when_processing_errors(sdp->device))
return -EBUSY;