linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi_error: do not allow IO errors with certain ILLEGAL_REQUEST sense to be retryable
@ 2011-12-02 20:31 Mike Snitzer
  2011-12-02 21:04 ` James Bottomley
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Mike Snitzer @ 2011-12-02 20:31 UTC (permalink / raw)
  To: linux-scsi
  Cc: James Bottomley, Hannes Reinecke, Martin K. Petersen,
	Mike Snitzer

Thin provisioned LUNs from multiple array vendors have failed WRITE SAME
(16) w/ UNMAP bit set with ILLEGAL_REQUEST sense.  With additional sense
0x24 and 0x26 respectively.

In both instances the target would always fail the CDB no matter how
many retries were performed (permanent target failure rather than
transient path failure).  This resulted in mkfs.ext4's discard of a
multipath device looping indefinitely while failing paths.

Additional sense 0x20 and 0x21 were included because both represent
TARGET_ERRORs too.  But not all ILLEGAL_REQUEST sense can be treated as
a TARGET_ERROR.

One example where a retry might be desirable is described in SBC-3, in
the "4.18 Model for XOR commands"

"When the device server is not able to accept a new command because
there is not enough space in the buffer, the device server shall
terminate that command with CHECK CONDITION status with the sense key
set to ILLEGAL REQUEST and the additional sense code set to BUFFER
FULL."

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
 drivers/scsi/scsi_error.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index dc6131e..33d3a50 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -366,6 +366,14 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
 			return TARGET_ERROR;
 
 	case ILLEGAL_REQUEST:
+		if (sshdr.asc == 0x20 || /* Invalid command operation code */
+		    sshdr.asc == 0x21 || /* Logical block address out of range */
+		    sshdr.asc == 0x24 || /* Invalid field in cdb */
+		    sshdr.asc == 0x26) { /* Parameter value invalid */
+			return TARGET_ERROR;
+		}
+		return SUCCESS;
+
 	default:
 		return SUCCESS;
 	}
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-02-13 23:35 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-02 20:31 [PATCH] scsi_error: do not allow IO errors with certain ILLEGAL_REQUEST sense to be retryable Mike Snitzer
2011-12-02 21:04 ` James Bottomley
2011-12-02 22:04   ` Mike Snitzer
2011-12-06 21:07 ` [PATCH] " Martin K. Petersen
2011-12-06 21:27   ` Mike Snitzer
2011-12-06 22:03     ` Martin K. Petersen
2011-12-06 22:42       ` Mike Snitzer
2012-02-13 16:29         ` Mike Snitzer
2012-02-13 17:53           ` Martin K. Petersen
2012-02-13 18:13             ` Mike Snitzer
2012-02-13 18:59               ` Mike Snitzer
2012-02-13 19:16               ` Martin K. Petersen
2012-02-13 19:36                 ` Mike Snitzer
2012-02-13 19:38                   ` James Bottomley
2012-02-13 23:35 ` [PATCH v2] [SCSI] scsi_error: classify some ILLEGAL_REQUEST sense as a permanent TARGET_ERROR Mike Snitzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).