linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi_error device offline fix
@ 2002-10-21  7:37 Mike Anderson
  2002-10-21 16:39 ` Richard Gooch
  2002-10-21 16:50 ` Mike Anderson
  0 siblings, 2 replies; 4+ messages in thread
From: Mike Anderson @ 2002-10-21  7:37 UTC (permalink / raw)
  To: linux-kernel, linux-scsi

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(-)
------

===== drivers/scsi/scsi_error.c 1.18 vs edited =====
--- 1.18/drivers/scsi/scsi_error.c	Thu Oct 17 10:52:39 2002
+++ edited/drivers/scsi/scsi_error.c	Sat Oct 19 15:24:06 2002
@@ -1145,14 +1145,18 @@
 		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);
 	}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scsi_error device offline fix
  2002-10-21  7:37 [PATCH] scsi_error device offline fix Mike Anderson
@ 2002-10-21 16:39 ` Richard Gooch
  2002-10-21 16:51   ` Mike Anderson
  2002-10-21 16:50 ` Mike Anderson
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Gooch @ 2002-10-21 16:39 UTC (permalink / raw)
  To: Mike Anderson; +Cc: linux-kernel, linux-scsi

Mike Anderson writes:
> This patch corrects a problem in scsi error handling.

For which kernel version?

				Regards,

					Richard....
Permanent: rgooch@atnf.csiro.au
Current:   rgooch@ras.ucalgary.ca

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scsi_error device offline fix
  2002-10-21  7:37 [PATCH] scsi_error device offline fix Mike Anderson
  2002-10-21 16:39 ` Richard Gooch
@ 2002-10-21 16:50 ` Mike Anderson
  1 sibling, 0 replies; 4+ messages in thread
From: Mike Anderson @ 2002-10-21 16:50 UTC (permalink / raw)
  To: linux-kernel, linux-scsi

Sorry for not stating clearly in the mail this patch is against 2.5.44

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scsi_error device offline fix
  2002-10-21 16:39 ` Richard Gooch
@ 2002-10-21 16:51   ` Mike Anderson
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Anderson @ 2002-10-21 16:51 UTC (permalink / raw)
  To: Richard Gooch; +Cc: linux-kernel, linux-scsi

Sorry for not making it clear in the mail this patch is against 2.5.44

Richard Gooch [rgooch@ras.ucalgary.ca] wrote:
> Mike Anderson writes:
> > This patch corrects a problem in scsi error handling.
> 
> For which kernel version?
> 
> 				Regards,
> 
> 					Richard....
> Permanent: rgooch@atnf.csiro.au
> Current:   rgooch@ras.ucalgary.ca
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-andmike
--
Michael Anderson
andmike@us.ibm.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-10-21 16:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-21  7:37 [PATCH] scsi_error device offline fix Mike Anderson
2002-10-21 16:39 ` Richard Gooch
2002-10-21 16:51   ` Mike Anderson
2002-10-21 16:50 ` Mike Anderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).