Commit 6532af8c authored by Mike Anderson's avatar Mike Anderson Committed by Christoph Hellwig

[PATCH] scsi_error device offline fix

This patch corrects a problem in scsi error handling.

When a device is offlined indicated by a message like ...Device offlined
- not ready...

the command return status was not being updated with a failure status if
the IO was a timeout.

I tested the patch on system with ips, aic, and qlogic fc adapters, but
was unable to generate a satisfactory device offline test case.

I did test this fix on uml with scsi_debug and generated a device
offline condition with verified this fix was working correctly.

-andmike
--
Michael Anderson
andmike@us.ibm.com

 scsi_error.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
parent 6eadbe0c
......@@ -1145,14 +1145,18 @@ static void scsi_eh_offline_sdevs(Scsi_Cmnd *sc_todo, struct Scsi_Host *shost)
if (!scsi_eh_eflags_chk(scmd, SCSI_EH_CMD_ERR))
continue;
printk(KERN_INFO "%s: Device offlined - not"
printk(KERN_INFO "scsi: Device offlined - not"
" ready or command retry failed"
" after error recovery: host"
" %d channel %d id %d lun %d\n",
__FUNCTION__, shost->host_no,
shost->host_no,
scmd->device->channel,
scmd->device->id,
scmd->device->lun);
if (scsi_eh_eflags_chk(scmd, SCSI_EH_CMD_TIMEOUT))
scmd->result |= (DRIVER_TIMEOUT << 24);
scmd->device->online = FALSE;
scsi_eh_finish_cmd(scmd, shost);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment