You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[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
@@ -458,7 +458,7 @@ int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd,
|
||||
* error processing, as long as the device was opened
|
||||
* non-blocking */
|
||||
if (filp && filp->f_flags & O_NONBLOCK) {
|
||||
if (sdev->host->shost_state == SHOST_RECOVERY)
|
||||
if (scsi_host_in_recovery(sdev->host))
|
||||
return -ENODEV;
|
||||
} else if (!scsi_block_when_processing_errors(sdev))
|
||||
return -ENODEV;
|
||||
|
||||
Reference in New Issue
Block a user