aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2011-12-13 17:55:33 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2011-12-16 01:29:04 -0500
commit895f3022523361e9b383cf48f51feb1f7d5e7e53 (patch)
tree6a692ebaacc4af38c8869eee0da7c6e868b1232a /include
parent6d5b59756033c2a029bde7262bb5f8d45f4ca952 (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/target/target_core_base.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index a74cb2be74de..daf532bc721a 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -35,6 +35,7 @@
35#define TRANSPORT_SENSE_BUFFER SCSI_SENSE_BUFFERSIZE 35#define TRANSPORT_SENSE_BUFFER SCSI_SENSE_BUFFERSIZE
36/* Used by transport_send_check_condition_and_sense() */ 36/* Used by transport_send_check_condition_and_sense() */
37#define SPC_SENSE_KEY_OFFSET 2 37#define SPC_SENSE_KEY_OFFSET 2
38#define SPC_ADD_SENSE_LEN_OFFSET 7
38#define SPC_ASC_KEY_OFFSET 12 39#define SPC_ASC_KEY_OFFSET 12
39#define SPC_ASCQ_KEY_OFFSET 13 40#define SPC_ASCQ_KEY_OFFSET 13
40#define TRANSPORT_IQN_LEN 224 41#define TRANSPORT_IQN_LEN 224