public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Muneendra <muneendra.kumar@broadcom.com>
To: linux-scsi@vger.kernel.org
Cc: hare@suse.de, jsmart2021@gmail.com, emilne@redhat.com,
	mkumar@redhat.com, Muneendra <muneendra.kumar@broadcom.com>
Subject: [PATCH 3/5] scsi: No retries on abort success
Date: Wed,  5 Aug 2020 08:21:00 +0530	[thread overview]
Message-ID: <1596595862-11075-4-git-send-email-muneendra.kumar@broadcom.com> (raw)
In-Reply-To: <1596595862-11075-1-git-send-email-muneendra.kumar@broadcom.com>

Made an additional check in scsi_noretry_cmd to verify whether user has
decided not to do retries on abort(issued on scsi timeouts) success  by
checking the SCMD_NORETRIES_ABORT bit

If SCMD_NORETRIES_ABORT bit is set we are making sure there won't be any
retries done on the same path and also setting the host byte as
DID_TRANSPORT_FAILFAST so that the error can be propogated as recoverable
transport error to the blk layers.

Signed-off-by: Muneendra <muneendra.kumar@broadcom.com>
---
 drivers/scsi/scsi_error.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 927b1e6..3222496 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1749,6 +1749,16 @@ int scsi_noretry_cmd(struct scsi_cmnd *scmd)
 
 check_type:
 	/*
+	 * Check whether caller has decided not to do retries on
+	 * abort success by setting the SCMD_NORETRIES_ABORT bit
+	 */
+	if ((test_bit(SCMD_NORETRIES_ABORT, &scmd->state)) &&
+		(scmd->request->cmd_flags & REQ_FAILFAST_TRANSPORT)) {
+		set_host_byte(scmd, DID_TRANSPORT_FAILFAST);
+		return 1;
+	}
+
+	/*
 	 * assume caller has checked sense and determined
 	 * the check condition was retryable.
 	 */
-- 
1.8.3.1


  parent reply	other threads:[~2020-08-05  9:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-05  2:50 [PATCH 0/5] scsi: Support to handle Intermittent errors Muneendra
2020-08-05  2:50 ` [PATCH 1/5] scsi: Added a new macro in scsi_cmnd.h Muneendra
2020-08-10  6:10   ` Hannes Reinecke
2020-08-05  2:50 ` [PATCH 2/5] scsi: Clear state bit SCMD_NORETRIES_ABORT of scsi_cmd before start request Muneendra
2020-08-10  6:11   ` Hannes Reinecke
2020-08-05  2:51 ` Muneendra [this message]
2020-08-10  6:19   ` [PATCH 3/5] scsi: No retries on abort success Hannes Reinecke
2020-08-05  2:51 ` [PATCH 4/5] scsi: Added routine to set SCMD_NORETRIES_ABORT bit for outstanding io on scsi_dev Muneendra
2020-08-10  6:20   ` Hannes Reinecke
2020-08-05  2:51 ` [PATCH 5/5] scsi_transport_fc: Added a new sysfs attribute noretries_abort Muneendra
2020-08-10  6:24   ` Hannes Reinecke
2020-08-11  6:01     ` Muneendra Kumar M
2020-08-11  6:35       ` Hannes Reinecke
2020-08-11  7:03         ` Muneendra Kumar M
2020-08-11 14:00           ` Hannes Reinecke
2020-08-14  5:33             ` Muneendra Kumar M

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=1596595862-11075-4-git-send-email-muneendra.kumar@broadcom.com \
    --to=muneendra.kumar@broadcom.com \
    --cc=emilne@redhat.com \
    --cc=hare@suse.de \
    --cc=jsmart2021@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mkumar@redhat.com \
    /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