Commit 12306b42 authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Nicholas Bellinger

scsi: Fix wrong additional sense length in descriptor format

The sense header additional sense length should be the accumulated
size of all the descriptors. Information descriptor size is 12 bytes.
When setting the additional sense length we should add 0xc instead of
0xa.
Signed-off-by: default avatarSagi Grimberg <sagig@mellanox.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 3e963b2d
...@@ -260,7 +260,7 @@ void scsi_set_sense_information(u8 *buf, u64 info) ...@@ -260,7 +260,7 @@ void scsi_set_sense_information(u8 *buf, u64 info)
len = buf[7]; len = buf[7];
ucp = (char *)scsi_sense_desc_find(buf, len + 8, 0); ucp = (char *)scsi_sense_desc_find(buf, len + 8, 0);
if (!ucp) { if (!ucp) {
buf[7] = len + 0xa; buf[7] = len + 0xc;
ucp = buf + 8 + len; ucp = buf + 8 + len;
} }
ucp[0] = 0; ucp[0] = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment