提交 a73c2a2f 编写于 作者: S Sagi Grimberg 提交者: Nicholas Bellinger

libiscsi: Use scsi helper to set information descriptor

In case encountered a PI error, use scsi_set_sense_information
instead of open coding information descriptor format.
Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
Reviewed-by: NHannes Reinecke <hare@suse.de>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
上级 4e4937e8
......@@ -853,12 +853,9 @@ static void iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
SAM_STAT_CHECK_CONDITION;
scsi_build_sense_buffer(1, sc->sense_buffer,
ILLEGAL_REQUEST, 0x10, ascq);
sc->sense_buffer[7] = 0xc; /* Additional sense length */
sc->sense_buffer[8] = 0; /* Information desc type */
sc->sense_buffer[9] = 0xa; /* Additional desc length */
sc->sense_buffer[10] = 0x80; /* Validity bit */
put_unaligned_be64(sector, &sc->sense_buffer[12]);
scsi_set_sense_information(sc->sense_buffer,
SCSI_SENSE_BUFFERSIZE,
sector);
goto out;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册