Skip to contentSkip to conversation

target: Set response format in INQUIRY response

PATCH Applied Roland Dreier 2 participants 4 messages Dec 6, 2011 – Dec 7, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target: Set response format in INQUIRY response

From: Roland Dreier <[email protected]>

Current SCSI specs say that the "response format" field in the standard INQUIRY response should be set to 2, and all the real SCSI devices I have do put 2 here. So let's do that too.

---
 drivers/target/target_core_cdb.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
drivers/target/target_core_cdb.c +12 -0
index 957fac7..0a96bbb 100644
@@ -96,6 +96,18 @@ target_emulate_inquiry_std(struct se_cmd *cmd)
 	buf[2] = dev->transport->get_device_rev(dev);
 
 	/*
+	 * NORMACA and HISUP = 0, RESPONSE DATA FORMAT = 2
+	 *
+	 * SPC4 says:
+	 *   A RESPONSE DATA FORMAT field set to 2h indicates that the
+	 *   standard INQUIRY data is in the format defined in this
+	 *   standard. Response data format values less than 2h are
+	 *   obsolete. Response data format values greater than 2h are
+	 *   reserved.
+	 */
+	buf[3] = 2;
+
+	/*
 	 * Enable SCCS and TPGS fields for Emulated ALUA
 	 */
 	if (dev->se_sub_dev->t10_alua.alua_type == SPC3_ALUA_EMULATED)
Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 24 lines · Roland Dreier

From: Roland Dreier <[email protected]>

Current SCSI specs say that the "response format" field in the standard INQUIRY response should be set to 2, and all the real SCSI devices I have do put 2 here. So let's do that too.

---
 drivers/target/target_core_cdb.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
drivers/target/target_core_cdb.c +5 -0
index 957fac7..0a96bbb 100644
@@ -96,6 +96,18 @@ target_emulate_inquiry_std(struct se_cmd *cmd)
 	buf[2] = dev->transport->get_device_rev(dev);
 
 	/*
+	 * NORMACA and HISUP = 0, RESPONSE DATA FORMAT = 2
+	 *
+	 * SPC4 says:
+	 *   A RESPONSE DATA FORMAT field set to 2h indicates that the
+	 *   standard INQUIRY data is in the format defined in this

drivers/target/target_core_cdb.c target_emulate_inquiry_std(struct se_cmd *cmd) · line 113

Quoted 10 lines
drivers/target/target_core_cdb.c +7 -0
+	 *   standard. Response data format values less than 2h are
+	 *   obsolete. Response data format values greater than 2h are
+	 *   reserved.
+	 */
+	buf[3] = 2;
+
+	/*
 	 * Enable SCCS and TPGS fields for Emulated ALUA
 	 */
 	if (dev->se_sub_dev->t10_alua.alua_type == SPC3_ALUA_EMULATED)

Applied to lio-core.git/master. Thanks Roland!

Out of curiosity, does this fix an bug in actual client usage..?

--nab

#2 lore raw
Quoted 1 line · Nicholas A. Bellinger

Out of curiosity, does this fix an bug in actual client usage..?

I think it was flagged by our analyzer software...

#3 lore raw
Quoted 5 lines · Roland Dreier
Quoted 1 line · Nicholas A. Bellinger

Out of curiosity, does this fix an bug in actual client usage..?

I think it was flagged by our analyzer software...

Ok, thanks for the extra clarification.

In that case I'll likely add it to target-pending.git/3.2-rc-fixes for a follow-up series after Linus pulls the current series of outstanding target patches for v3.2-rc.

Thanks,

--nab