提交 9b5cd132 编写于 作者: M Martin K. Petersen 提交者: James Bottomley

[SCSI] mpt2sas: Return the correct sense key for DIF errors

Only a target device should return ABORTED COMMAND when a PI error is
discovered. The HBA should always set the sense key to ILLEGAL REQUEST.
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Acked-by: N"Sreekanth Reddy" <Sreekanth.reddy@lsi.com>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 d974e426
...@@ -3772,8 +3772,6 @@ static void ...@@ -3772,8 +3772,6 @@ static void
_scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status) _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
{ {
u8 ascq; u8 ascq;
u8 sk;
u8 host_byte;
switch (ioc_status) { switch (ioc_status) {
case MPI2_IOCSTATUS_EEDP_GUARD_ERROR: case MPI2_IOCSTATUS_EEDP_GUARD_ERROR:
...@@ -3790,16 +3788,8 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status) ...@@ -3790,16 +3788,8 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
break; break;
} }
if (scmd->sc_data_direction == DMA_TO_DEVICE) { scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST, 0x10, ascq);
sk = ILLEGAL_REQUEST; scmd->result = DRIVER_SENSE << 24 | (DID_ABORT << 16) |
host_byte = DID_ABORT;
} else {
sk = ABORTED_COMMAND;
host_byte = DID_OK;
}
scsi_build_sense_buffer(0, scmd->sense_buffer, sk, 0x10, ascq);
scmd->result = DRIVER_SENSE << 24 | (host_byte << 16) |
SAM_STAT_CHECK_CONDITION; SAM_STAT_CHECK_CONDITION;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册