summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMuneendra Kumar <muneendra.kumar@broadcom.com>2021-01-07 00:49:04 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2021-01-15 06:55:17 +0300
commit962c8dcdd5fa680e2bd68320d54e797b6d8c17fe (patch)
tree30b4876c54e58acac5acd6e109db478c4c4ce90c /drivers
parent032d1900869f3478cdbecc42e9f54feb03ffa730 (diff)
downloadlinux-962c8dcdd5fa680e2bd68320d54e797b6d8c17fe.tar.xz
scsi: core: Add a new error code DID_TRANSPORT_MARGINAL in scsi.h
Add 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. Add DID_TRANSPORT_MARGINAL case to scsi_decide_disposition(). Link: https://lore.kernel.org/r/1609969748-17684-2-git-send-email-muneendra.kumar@broadcom.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Reviewed-by: Ewan D. Milne <emilne@redhat.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Muneendra Kumar <muneendra.kumar@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/scsi_error.c6
-rw-r--r--drivers/scsi/scsi_lib.c1
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index f11f51e2465f..28056ee498b3 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1861,6 +1861,12 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
* the fast io fail tmo fired), so send IO directly upwards.
*/
return SUCCESS;
+ case DID_TRANSPORT_MARGINAL:
+ /*
+ * caller has decided not to do retries on
+ * abort success, so send IO directly upwards
+ */
+ return SUCCESS;
case DID_ERROR:
if (msg_byte(scmd->result) == COMMAND_COMPLETE &&
status_byte(scmd->result) == RESERVATION_CONFLICT)
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index b3f14f05340a..d0ae586565f8 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -630,6 +630,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);