Skip to content

Commit

Permalink
[SCSI] Do not retry a request whose data integrity check failed
Browse files Browse the repository at this point in the history
If initiator or target reject the I/O due to DIF errors there is no
point in retrying.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
  • Loading branch information
Martin K. Petersen authored and James Bottomley committed Jul 26, 2008
1 parent 7027ad7 commit 511e44f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions drivers/scsi/scsi_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 7 additions & 2 deletions drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 511e44f

Please sign in to comment.