public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] target: Set response format in INQUIRY response
@ 2011-12-06 18:02 Roland Dreier
  2011-12-06 23:38 ` Nicholas A. Bellinger
  0 siblings, 1 reply; 4+ messages in thread
From: Roland Dreier @ 2011-12-06 18:02 UTC (permalink / raw)
  To: Nicholas A. Bellinger; +Cc: target-devel, linux-scsi

From: Roland Dreier <roland@purestorage.com>

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.

Signed-off-by: Roland Dreier <roland@purestorage.com>
---
 drivers/target/target_core_cdb.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c
index 957fac7..0a96bbb 100644
--- a/drivers/target/target_core_cdb.c
+++ b/drivers/target/target_core_cdb.c
@@ -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)
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] target: Set response format in INQUIRY response
  2011-12-06 18:02 [PATCH] target: Set response format in INQUIRY response Roland Dreier
@ 2011-12-06 23:38 ` Nicholas A. Bellinger
  2011-12-07  1:36   ` Roland Dreier
  0 siblings, 1 reply; 4+ messages in thread
From: Nicholas A. Bellinger @ 2011-12-06 23:38 UTC (permalink / raw)
  To: Roland Dreier; +Cc: target-devel, linux-scsi

On Tue, 2011-12-06 at 10:02 -0800, Roland Dreier wrote:
> From: Roland Dreier <roland@purestorage.com>
> 
> 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.
> 
> Signed-off-by: Roland Dreier <roland@purestorage.com>
> ---
>  drivers/target/target_core_cdb.c |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c
> index 957fac7..0a96bbb 100644
> --- a/drivers/target/target_core_cdb.c
> +++ b/drivers/target/target_core_cdb.c
> @@ -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)

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

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

--nab

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] target: Set response format in INQUIRY response
  2011-12-06 23:38 ` Nicholas A. Bellinger
@ 2011-12-07  1:36   ` Roland Dreier
  2011-12-07  2:01     ` Nicholas A. Bellinger
  0 siblings, 1 reply; 4+ messages in thread
From: Roland Dreier @ 2011-12-07  1:36 UTC (permalink / raw)
  To: Nicholas A. Bellinger; +Cc: target-devel, linux-scsi

On Tue, Dec 6, 2011 at 3:38 PM, Nicholas A. Bellinger
<nab@linux-iscsi.org> wrote:
> Out of curiosity, does this fix an bug in actual client usage..?

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] target: Set response format in INQUIRY response
  2011-12-07  1:36   ` Roland Dreier
@ 2011-12-07  2:01     ` Nicholas A. Bellinger
  0 siblings, 0 replies; 4+ messages in thread
From: Nicholas A. Bellinger @ 2011-12-07  2:01 UTC (permalink / raw)
  To: Roland Dreier; +Cc: target-devel, linux-scsi

On Tue, 2011-12-06 at 17:36 -0800, Roland Dreier wrote:
> On Tue, Dec 6, 2011 at 3:38 PM, Nicholas A. Bellinger
> <nab@linux-iscsi.org> wrote:
> > 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-12-07  2:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-06 18:02 [PATCH] target: Set response format in INQUIRY response Roland Dreier
2011-12-06 23:38 ` Nicholas A. Bellinger
2011-12-07  1:36   ` Roland Dreier
2011-12-07  2:01     ` Nicholas A. Bellinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox