diff options
author | Mike Snitzer <snitzer@redhat.com> | 2012-02-13 18:35:11 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-19 10:39:59 -0500 |
commit | 47ac56db133cb0b6cf3c8b156db854c158fb9dae (patch) | |
tree | f7b203048444d6aad66c24d9285388058e34cc67 /drivers/scsi | |
parent | 89730393f260aef7fce9f6fd475da148517a4c5c (diff) |
[SCSI] scsi_error: classify some ILLEGAL_REQUEST sense as a permanent TARGET_ERROR
Permanent target failures are non-retryable and should be classified as
TARGET_ERROR; otherwise dm-multipath will retry an IO request that will
always fail at the target.
A SCSI command that fails with ILLEGAL_REQUEST sense and Additional
sense 0x20, 0x21, 0x24 or 0x26 represents a permanent TARGET_ERROR.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | 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 6ae3b5dbd379..f66e90db3bee 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) | |||
366 | return TARGET_ERROR; | 366 | return TARGET_ERROR; |
367 | 367 | ||
368 | case ILLEGAL_REQUEST: | 368 | case ILLEGAL_REQUEST: |
369 | if (sshdr.asc == 0x20 || /* Invalid command operation code */ | ||
370 | sshdr.asc == 0x21 || /* Logical block address out of range */ | ||
371 | sshdr.asc == 0x24 || /* Invalid field in cdb */ | ||
372 | sshdr.asc == 0x26) { /* Parameter value invalid */ | ||
373 | return TARGET_ERROR; | ||
374 | } | ||
375 | return SUCCESS; | ||
376 | |||
369 | default: | 377 | default: |
370 | return SUCCESS; | 378 | return SUCCESS; |
371 | } | 379 | } |