]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
target: Set additional sense length field in sense data
authorRoland Dreier <roland@purestorage.com>
Tue, 13 Dec 2011 22:55:33 +0000 (14:55 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 16 Dec 2011 06:29:04 +0000 (06:29 +0000)
commit895f3022523361e9b383cf48f51feb1f7d5e7e53
tree6a692ebaacc4af38c8869eee0da7c6e868b1232a
parent6d5b59756033c2a029bde7262bb5f8d45f4ca952
target: Set additional sense length field in sense data

The target code was not setting the additional sense length field in the
sense data it returned, which meant that at least the Linux stack
ignored the ASC/ASCQ fields.  For example, without this patch, on a
tcm_loop device:

    # sg_raw -v /dev/sda 2 0 0 0 0 0

gives

        cdb to send: 02 00 00 00 00 00
    SCSI Status: Check Condition

    Sense Information:
     Fixed format, current;  Sense key: Illegal Request
      Raw sense data (in hex):
            70 00 05 00 00 00 00 00

while after the patch we correctly get the following (which matches what
a regular disk returns):

        cdb to send: 02 00 00 00 00 00
    SCSI Status: Check Condition

    Sense Information:
     Fixed format, current;  Sense key: Illegal Request
     Additional sense: Invalid command operation code
     Raw sense data (in hex):
            70 00 05 00 00 00 00 0a  00 00 00 00 20 00 00 00
            00 00

Signed-off-by: Roland Dreier <roland@purestorage.com>
Cc: stable@kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c
include/target/target_core_base.h