public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladislav Bolkhovitin <vst@vlnb.net>
To: linux-scsi@vger.kernel.org
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Subject: [PATCH]: TASK ABORTED status handling improvement
Date: Thu, 06 Nov 2008 13:57:52 +0300	[thread overview]
Message-ID: <4912CDB0.6010101@vlnb.net> (raw)

This patch improves handling of TASK ABORTED status by Linux SCSI mid-layer. Currently,
command returned with this status considered failed and returned to upper layers. It
leads to additional error recovery load on file systems and block layer, which sometimes
can cause undesired side effects, like I/O errors and file systems corruptions. See
http://lkml.org/lkml/2008/11/1/38, for instance.

>From other side, TASK ABORTED status is returned by SCSI target if the corresponding
command was aborted by another initiator and the target has TAS bit set in the control
mode page. So, in the majority of cases commands with TASK ABORTED status should be
simply retried. In other cases, maybe_retry path will not retry if no retries are allowed.

This patch implement suggestion by James Bottomley from http://marc.info/?l=linux-scsi&m=121932916906009&w=2.

Signed-off-by: Vladislav Bolkhovitin <vst@vlnb.net>

 scsi_error.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -upr linux-2.6.27.2/drivers/scsi/scsi_error.c linux-2.6.27.2/drivers/scsi/scsi_error.c
--- linux-2.6.27.2/drivers/scsi/scsi_error.c	2008-10-10 02:13:53.000000000 +0400
+++ linux-2.6.27.2/drivers/scsi/scsi_error.c	2008-11-01 21:50:56.000000000 +0300
@@ -1408,8 +1408,9 @@ int scsi_decide_disposition(struct scsi_
 		return ADD_TO_MLQUEUE;
 	case GOOD:
 	case COMMAND_TERMINATED:
-	case TASK_ABORTED:
 		return SUCCESS;
+	case TASK_ABORTED:
+		goto maybe_retry;
 	case CHECK_CONDITION:
 		rtn = scsi_check_sense(scmd);
 		if (rtn == NEEDS_RETRY)


                 reply	other threads:[~2008-11-06 10:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4912CDB0.6010101@vlnb.net \
    --to=vst@vlnb.net \
    --cc=James.Bottomley@HansenPartnership.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