public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lk 2.4.27 error handling, ad infinitum
@ 2004-09-02  9:57 Douglas Gilbert
  2004-09-02 11:44 ` Saeed Bishara
  2004-09-03  0:06 ` Douglas Gilbert
  0 siblings, 2 replies; 3+ messages in thread
From: Douglas Gilbert @ 2004-09-02  9:57 UTC (permalink / raw)
  To: SCSI development list; +Cc: Saeed.Bishara

[-- Attachment #1: Type: text/plain, Size: 648 bytes --]

dougg wrote:
 > The following scenario has been brought to my attention.
 >
 > While handling a error (e.g. a timeout) the
 > scsi_send_eh_cmnd() function issues a (stalled) queued command.
 > Now that command hits a repeatable failure (e.g. MEDIUM ERROR).
 >
 > In this scaenario it would seem that the "goto retry" forms
 > an infinite loop re-issuing that command on the same (broken)
 > block.
 >
 > Comments?

No comments, so how about this patch. When the eh retries are
exhausted the code drops through to FAILED state. If a command
in foreground (i.e. not sent by the eh handler) exceeds it retries
then SUCCESS is returned??

Doug Gilbert

[-- Attachment #2: scsi_error2427_retry.diff --]
[-- Type: text/x-patch, Size: 425 bytes --]

--- linux/drivers/scsi/scsi_error.c	2004-04-17 19:30:54.000000000 +1000
+++ linux/drivers/scsi/scsi_error.c2427retry	2004-09-02 19:45:07.858674640 +1000
@@ -664,7 +664,9 @@
 			SCpnt->eh_state = SUCCESS;
 			break;
 		case NEEDS_RETRY:
-			goto retry;
+			if ((++SCpnt->retries) < SCpnt->allowed)
+				goto retry;
+			/* fall through to FAILED if retries exceeded */
 		case FAILED:
 		default:
 			SCpnt->eh_state = FAILED;

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

* Re: [PATCH] lk 2.4.27 error handling, ad infinitum
  2004-09-02  9:57 [PATCH] lk 2.4.27 error handling, ad infinitum Douglas Gilbert
@ 2004-09-02 11:44 ` Saeed Bishara
  2004-09-03  0:06 ` Douglas Gilbert
  1 sibling, 0 replies; 3+ messages in thread
From: Saeed Bishara @ 2004-09-02 11:44 UTC (permalink / raw)
  To: dougg; +Cc: SCSI development list

falling into FAILED status will put the device in offline state, isn't it?
saeed

Douglas Gilbert wrote:

> dougg wrote:
> > The following scenario has been brought to my attention.
> >
> > While handling a error (e.g. a timeout) the
> > scsi_send_eh_cmnd() function issues a (stalled) queued command.
> > Now that command hits a repeatable failure (e.g. MEDIUM ERROR).
> >
> > In this scaenario it would seem that the "goto retry" forms
> > an infinite loop re-issuing that command on the same (broken)
> > block.
> >
> > Comments?
>
> No comments, so how about this patch. When the eh retries are
> exhausted the code drops through to FAILED state. If a command
> in foreground (i.e. not sent by the eh handler) exceeds it retries
> then SUCCESS is returned??
>
> Doug Gilbert
>
>------------------------------------------------------------------------
>
>--- linux/drivers/scsi/scsi_error.c	2004-04-17 19:30:54.000000000 +1000
>+++ linux/drivers/scsi/scsi_error.c2427retry	2004-09-02 19:45:07.858674640 +1000
>@@ -664,7 +664,9 @@
> 			SCpnt->eh_state = SUCCESS;
> 			break;
> 		case NEEDS_RETRY:
>-			goto retry;
>+			if ((++SCpnt->retries) < SCpnt->allowed)
>+				goto retry;
>+			/* fall through to FAILED if retries exceeded */
> 		case FAILED:
> 		default:
> 			SCpnt->eh_state = FAILED;
>  
>



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

* Re: [PATCH] lk 2.4.27 error handling, ad infinitum
  2004-09-02  9:57 [PATCH] lk 2.4.27 error handling, ad infinitum Douglas Gilbert
  2004-09-02 11:44 ` Saeed Bishara
@ 2004-09-03  0:06 ` Douglas Gilbert
  1 sibling, 0 replies; 3+ messages in thread
From: Douglas Gilbert @ 2004-09-03  0:06 UTC (permalink / raw)
  To: SCSI development list; +Cc: Saeed.Bishara, marcelo.tosatti

[-- Attachment #1: Type: text/plain, Size: 928 bytes --]

Douglas Gilbert wrote:
> dougg wrote:
>  > The following scenario has been brought to my attention.
>  >
>  > While handling a error (e.g. a timeout) the
>  > scsi_send_eh_cmnd() function issues a (stalled) queued command.
>  > Now that command hits a repeatable failure (e.g. MEDIUM ERROR).
>  >
>  > In this scaenario it would seem that the "goto retry" forms
>  > an infinite loop re-issuing that command on the same (broken)
>  > block.
>  >
>  > Comments?
> 
> No comments, so how about this patch. When the eh retries are
> exhausted the code drops through to FAILED state. If a command
> in foreground (i.e. not sent by the eh handler) exceeds it retries
> then SUCCESS is returned??

Saeed reports that breaking out of the retry loop with
eh_state set to SUCCESS does successfully handle the
problem.

Change:
    - break out of a repeatable error retries when already
      in "eh" (error handling) mode

Doug Gilbert


[-- Attachment #2: scsi_error2427_retry2.diff --]
[-- Type: text/x-patch, Size: 416 bytes --]

--- linux/drivers/scsi/scsi_error.c	2004-04-17 19:30:54.000000000 +1000
+++ linux/drivers/scsi/scsi_error.c2427retry2	2004-09-03 09:47:27.174358136 +1000
@@ -664,7 +664,10 @@
 			SCpnt->eh_state = SUCCESS;
 			break;
 		case NEEDS_RETRY:
-			goto retry;
+			if ((++SCpnt->retries) < SCpnt->allowed)
+				goto retry;
+			SCpnt->eh_state = SUCCESS;
+			break;
 		case FAILED:
 		default:
 			SCpnt->eh_state = FAILED;

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

end of thread, other threads:[~2004-09-03  0:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-02  9:57 [PATCH] lk 2.4.27 error handling, ad infinitum Douglas Gilbert
2004-09-02 11:44 ` Saeed Bishara
2004-09-03  0:06 ` Douglas Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox