Skip to content

Commit

Permalink
[SCSI] scsi_error: classify some ILLEGAL_REQUEST sense as a permanent…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Mike Snitzer authored and James Bottomley committed Feb 19, 2012
1 parent 8973039 commit 47ac56d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/scsi/scsi_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 47ac56d

Please sign in to comment.