linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: michaelc@cs.wisc.edu
To: dm-devel@redhat.com, linux-scsi@vger.kernel.org
Cc: Mike Christie <michaelc@cs.wisc.edu>
Subject: [PATCH 7/7] scsi: Support fail fast bits
Date: Wed,  4 Jun 2008 20:41:46 -0500	[thread overview]
Message-ID: <1212630106-13413-8-git-send-email-michaelc@cs.wisc.edu> (raw)
In-Reply-To: <1212630106-13413-7-git-send-email-michaelc@cs.wisc.edu>

From: Mike Christie <michaelc@cs.wisc.edu>

This converts scsi decide disposition to handle to the different
types of failfast that can be requested.

I was not sure if some of these were device or driver or transport
errors. For example I made DID_PARITY a device error, but I thought
maybe this could be a device or transport error. Also DID_ERROR seems
to be used for lots of different errors, so I was not sure how
to classify it.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
 drivers/scsi/scsi_error.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index d257210..555085a 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1288,6 +1288,7 @@ static void scsi_eh_offline_sdevs(struct list_head *work_q,
 int scsi_decide_disposition(struct scsi_cmnd *scmd)
 {
 	int rtn;
+	int retry_flag = 0;
 
 	/*
 	 * if the device is offline, then we clearly just pass the result back
@@ -1337,6 +1338,7 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
 		 * and not get stuck in a loop.
 		 */
 	case DID_SOFT_ERROR:
+		retry_flag = REQ_FAILFAST_DRIVER;
 		goto maybe_retry;
 	case DID_IMM_RETRY:
 		return NEEDS_RETRY;
@@ -1368,10 +1370,13 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
 			 * lower down
 			 */
 			break;
-		/* fallthrough */
-
+		retry_flag = REQ_FAILFAST_DRIVER;
+		goto maybe_retry;
 	case DID_BUS_BUSY:
+		retry_flag = REQ_FAILFAST_TRANSPORT;
+		goto maybe_retry;
 	case DID_PARITY:
+		retry_flag = REQ_FAILFAST_DEV;
 		goto maybe_retry;
 	case DID_TIME_OUT:
 		/*
@@ -1420,8 +1425,10 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
 		return SUCCESS;
 	case CHECK_CONDITION:
 		rtn = scsi_check_sense(scmd);
-		if (rtn == NEEDS_RETRY)
+		if (rtn == NEEDS_RETRY) {
+			retry_flag = REQ_FAILFAST_DEV;
 			goto maybe_retry;
+		}
 		/* if rtn == FAILED, we have no sense information;
 		 * returning FAILED will wake the error handler thread
 		 * to collect the sense and redo the decide
@@ -1451,8 +1458,8 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
 	 * the request was not marked fast fail.  Note that above,
 	 * even if the request is marked fast fail, we still requeue
 	 * for queue congestion conditions (QUEUE_FULL or BUSY) */
-	if ((++scmd->retries) <= scmd->allowed
-	    && !blk_noretry_request(scmd->request)) {
+	if ((++scmd->retries) <= scmd->allowed &&
+	    !(scmd->request->cmd_flags & retry_flag)) {
 		return NEEDS_RETRY;
 	} else {
 		/*
-- 
1.5.4.1

  reply	other threads:[~2008-06-05  1:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-05  1:41 block and scsi fail fast fixes michaelc
2008-06-05  1:41 ` [PATCH 1/7] scsi: add transport host byte errors (v2) michaelc
2008-06-05  1:41   ` [PATCH 2/7] iscsi class, libiscsi and qla4xxx: convert to new transport host byte values michaelc
2008-06-05  1:41     ` [PATCH 3/7] fc class: Add support for new transport errors michaelc
2008-06-05  1:41       ` [PATCH 4/7] qla2xxx: use new host byte " michaelc
2008-06-05  1:41         ` [PATCH 5/7] lpfc: start to use new trasnport errors michaelc
2008-06-05  1:41           ` [PATCH 6/7] block and drivers: separate failfast into multiple bits michaelc
2008-06-05  1:41             ` michaelc [this message]
2008-08-19 15:35       ` [PATCH 3/7] fc class: Add support for new transport errors James Smart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1212630106-13413-8-git-send-email-michaelc@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=dm-devel@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).