diff options
author | James Bottomley <James.Bottomley@steeleye.com> | 2005-09-18 15:05:20 -0500 |
---|---|---|
committer | James Bottomley <jejb@titanic.(none)> | 2005-09-19 09:24:52 -0500 |
commit | 939647ee308e0ad924e776657704c7bedd498664 (patch) | |
tree | cfff68b8f65a53e186fd1e7443aa370885ac1ed9 /drivers/scsi/scsi.c | |
parent | a64358db1253b35d508a411e80a3ad23b859ec88 (diff) | |
download | kernel_samsung_crespo-939647ee308e0ad924e776657704c7bedd498664.zip kernel_samsung_crespo-939647ee308e0ad924e776657704c7bedd498664.tar.gz kernel_samsung_crespo-939647ee308e0ad924e776657704c7bedd498664.tar.bz2 |
[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/scsi.c')
-rw-r--r-- | drivers/scsi/scsi.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index a780546..1f0ebab 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -1265,9 +1265,8 @@ int scsi_device_cancel(struct scsi_device *sdev, int recovery) list_for_each_safe(lh, lh_sf, &active_list) { scmd = list_entry(lh, struct scsi_cmnd, eh_entry); list_del_init(lh); - if (recovery) { - scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD); - } else { + if (recovery && + !scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD)) { scmd->result = (DID_ABORT << 16); scsi_finish_command(scmd); } |