From: Muneendra <muneendra.kumar@broadcom.com>
To: linux-scsi@vger.kernel.org, hare@suse.de
Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com,
Muneendra <muneendra.kumar@broadcom.com>
Subject: [PATCH v3 03/17] scsi: No retries on abort success
Date: Thu, 15 Oct 2020 08:57:28 +0530 [thread overview]
Message-ID: <1602732462-10443-4-git-send-email-muneendra.kumar@broadcom.com> (raw)
In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com>
[-- Attachment #1: Type: text/plain, Size: 2031 bytes --]
Made an additional check in scsi_noretry_cmd to verify whether user has
decided not to do retries on abort success by setting 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_MARGINAL so that the error can be propogated as recoverable
transport error to the blk layers.
Added a code in scsi_result_to_blk_status to translate
a new error DID_TRANSPORT_MARGINAL to the corresponding blk_status_t
i.e BLK_STS_TRANSPORT
Signed-off-by: Muneendra <muneendra.kumar@broadcom.com>
---
v3:
Merged first part of the previous patch(v2 patch3) with
this patch.
v2:
set the hostbyte as DID_TRANSPORT_MARGINAL instead of
DID_TRANSPORT_FAILFAST.
---
drivers/scsi/scsi_error.c | 10 ++++++++++
drivers/scsi/scsi_lib.c | 1 +
2 files changed, 11 insertions(+)
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index ae80daa5d831..aa30c1c9e9db 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1763,6 +1763,16 @@ int scsi_noretry_cmd(struct scsi_cmnd *scmd)
return 0;
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_MARGINAL);
+ return 1;
+ }
+
/*
* assume caller has checked sense and determined
* the check condition was retryable.
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 2b5dea07498e..9606bad1542f 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -629,6 +629,7 @@ static blk_status_t scsi_result_to_blk_status(struct scsi_cmnd *cmd, int result)
return BLK_STS_OK;
return BLK_STS_IOERR;
case DID_TRANSPORT_FAILFAST:
+ case DID_TRANSPORT_MARGINAL:
return BLK_STS_TRANSPORT;
case DID_TARGET_FAILURE:
set_host_byte(cmd, DID_OK);
--
2.26.2
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4177 bytes --]
next prev parent reply other threads:[~2020-10-15 10:21 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-15 3:27 [PATCH v3 00/17] scsi: Support to handle Intermittent errors Muneendra
2020-10-15 3:27 ` [PATCH v3 01/17] scsi: Added a new definition in scsi_cmnd.h Muneendra
2020-10-15 3:27 ` [PATCH v3 02/17] scsi: Added a new error code in scsi.h Muneendra
2020-10-15 3:27 ` Muneendra [this message]
2020-10-16 18:37 ` [PATCH v3 03/17] scsi: No retries on abort success Mike Christie
2020-10-19 19:05 ` Mike Christie
2020-10-19 19:26 ` Muneendra Kumar M
2020-10-20 19:53 ` Mike Christie
2020-10-20 20:18 ` Mike Christie
2020-10-21 18:51 ` Muneendra Kumar M
2020-10-15 3:27 ` [PATCH v3 04/17] scsi: Added routine to set/clear SCMD_NORETRIES_ABORT bit for outstanding io on scsi_dev Muneendra
2020-10-15 3:27 ` [PATCH v3 05/17] scsi_transport_fc: Added a new rport state FC_PORTSTATE_MARGINAL Muneendra
2020-10-16 19:52 ` Mike Christie
2020-10-19 10:47 ` Muneendra Kumar M
2020-10-19 16:10 ` Michael Christie
2020-10-19 16:19 ` Michael Christie
2020-10-19 17:16 ` Hannes Reinecke
2020-10-19 17:31 ` Muneendra Kumar M
2020-10-19 18:55 ` Mike Christie
2020-10-19 19:03 ` Muneendra Kumar M
2020-10-20 18:24 ` Benjamin Marzinski
2020-10-20 6:03 ` Hannes Reinecke
2020-10-19 18:03 ` Muneendra Kumar M
2020-10-19 18:44 ` Mike Christie
2020-10-19 18:55 ` Muneendra Kumar M
2020-10-20 16:48 ` Mike Christie
2020-10-20 17:19 ` Muneendra Kumar M
2020-10-20 18:44 ` Benjamin Marzinski
2020-10-20 18:14 ` Benjamin Marzinski
2020-10-15 3:27 ` [PATCH v3 06/17] scsi_transport_fc: Added store fucntionality to set the rport port_state using sysfs Muneendra
2020-10-15 14:05 ` kernel test robot
2020-10-16 18:34 ` Mike Christie
2020-10-19 10:52 ` Muneendra Kumar M
2020-10-15 3:27 ` [PATCH v3 07/17] scsi:lpfc: Added changes to fc_remote_port_chkready Muneendra
2020-10-15 3:27 ` [PATCH v3 08/17] scsi:qla2xx: " Muneendra
2020-10-15 3:27 ` [PATCH v3 09/17] scsi:qedf: " Muneendra
2020-10-15 3:27 ` [PATCH v3 10/17] scsi:libfc: " Muneendra
2020-10-15 3:27 ` [PATCH v3 11/17] scsi:ibmvfc: " Muneendra
2020-10-15 3:27 ` [PATCH v3 12/17] scsi:fnic: " Muneendra
2020-10-15 3:27 ` [PATCH v3 13/17] scsi:bnx2fc: " Muneendra
2020-10-15 3:27 ` [PATCH v3 14/17] scsi:csio: " Muneendra
2020-10-15 3:27 ` [PATCH v3 15/17] scsi:bfa: " Muneendra
2020-10-15 3:27 ` [PATCH v3 16/17] scsi:zfcp: " Muneendra
2020-10-22 16:50 ` Benjamin Block
2020-10-15 3:27 ` [PATCH v3 17/17] scsi:mpt: " Muneendra
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=1602732462-10443-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