Skip to content

Commit

Permalink
scsi: Fix wrong additional sense length in descriptor format
Browse files Browse the repository at this point in the history
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: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Sagi Grimberg authored and Nicholas Bellinger committed Jul 24, 2015
1 parent 3e963b2 commit 12306b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/scsi_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ void scsi_set_sense_information(u8 *buf, u64 info)
len = buf[7];
ucp = (char *)scsi_sense_desc_find(buf, len + 8, 0);
if (!ucp) {
buf[7] = len + 0xa;
buf[7] = len + 0xc;
ucp = buf + 8 + len;
}
ucp[0] = 0;
Expand Down

0 comments on commit 12306b4

Please sign in to comment.