[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>
This commit is contained in:
committed by
James Bottomley
parent
a64358db12
commit
939647ee30
@@ -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;
|
||||
|
Reference in New Issue
Block a user