From: Martin K. Petersen Date: Thu, 17 Jul 2008 08:28:33 +0000 (-0400) Subject: [SCSI] Do not retry a request whose data integrity check failed X-Git-Tag: v2.6.27-rc1~55^2~21 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=511e44f42e3239a4df77b8e0e46d294d98a768ad;p=linux-2.6 [SCSI] Do not retry a request whose data integrity check failed If initiator or target reject the I/O due to DIF errors there is no point in retrying. Signed-off-by: Martin K. Petersen Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index a69397fd31..fc4b2d05f2 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -344,6 +344,9 @@ static int scsi_check_sense(struct scsi_cmnd *scmd) return /* soft_error */ SUCCESS; case ABORTED_COMMAND: + if (sshdr.asc == 0x10) /* DIF */ + return SUCCESS; + return NEEDS_RETRY; case NOT_READY: case UNIT_ATTENTION: diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index a47c05d782..a20730c480 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -950,9 +950,14 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) * 6-byte command. */ scsi_requeue_command(q, cmd); - return; - } else { + } else if (sshdr.asc == 0x10) /* DIX */ + scsi_end_request(cmd, -EIO, this_count, 0); + else scsi_end_request(cmd, -EIO, this_count, 1); + return; + case ABORTED_COMMAND: + if (sshdr.asc == 0x10) { /* DIF */ + scsi_end_request(cmd, -EIO, this_count, 0); return; } break;