scsi: Fix wrong additional sense length in descriptor format
authorSagi Grimberg <sagig@mellanox.com>
Wed, 15 Jul 2015 07:55:36 +0000 (10:55 +0300)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 24 Jul 2015 05:48:49 +0000 (22:48 -0700)
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>
drivers/scsi/scsi_common.c

index 41432c10dda2fa549c84be84bbb660d23321dec8..ee6bdf43a8ea35114b6163e14910bde92c136caf 100644 (file)
@@ -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;