提交 511e44f4 编写于 作者: M Martin K. Petersen 提交者: James Bottomley

[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: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
上级 7027ad72
...@@ -344,6 +344,9 @@ static int scsi_check_sense(struct scsi_cmnd *scmd) ...@@ -344,6 +344,9 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
return /* soft_error */ SUCCESS; return /* soft_error */ SUCCESS;
case ABORTED_COMMAND: case ABORTED_COMMAND:
if (sshdr.asc == 0x10) /* DIF */
return SUCCESS;
return NEEDS_RETRY; return NEEDS_RETRY;
case NOT_READY: case NOT_READY:
case UNIT_ATTENTION: case UNIT_ATTENTION:
......
...@@ -950,9 +950,14 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) ...@@ -950,9 +950,14 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
* 6-byte command. * 6-byte command.
*/ */
scsi_requeue_command(q, cmd); scsi_requeue_command(q, cmd);
return; } else if (sshdr.asc == 0x10) /* DIX */
} else { scsi_end_request(cmd, -EIO, this_count, 0);
else
scsi_end_request(cmd, -EIO, this_count, 1); 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; return;
} }
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册