Blob Blame History Raw
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 17 Oct 2017 09:10:56 +0200
Subject: [PATCH] scsi: scsi_error: Do not retry illegal function error
References: bsc#1077989
Git-commit: a8bbb2ab4e4fac8ebd2a402d5d81500cbeaaebaf
Patch-mainline: v4.15-rc1

Hitachi USP-V returns 'ILLEGAL FUNCTION' when the internal staging
mechanism encountered an error. These errors should not be retried on
another path.

[mkp: s/invalid/illegal/]

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
---
 drivers/scsi/scsi_error.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index bcc3aa51d0b5..a6c2b41b607f 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -580,6 +580,7 @@ int scsi_check_sense(struct scsi_cmnd *scmd)
 	case ILLEGAL_REQUEST:
 		if (sshdr.asc == 0x20 || /* Invalid command operation code */
 		    sshdr.asc == 0x21 || /* Logical block address out of range */
+		    sshdr.asc == 0x22 || /* Invalid function */
 		    sshdr.asc == 0x24 || /* Invalid field in cdb */
 		    sshdr.asc == 0x26 || /* Parameter value invalid */
 		    sshdr.asc == 0x27) { /* Write protected */
-- 
2.12.3