linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target: respond to unknown initiators with sensible REPORT LUNS list length
@ 2015-07-22 22:08 Spencer Baugh
  2015-07-23  9:41 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Spencer Baugh @ 2015-07-22 22:08 UTC (permalink / raw)
  To: Nicholas A. Bellinger, open list:TARGET SUBSYSTEM,
	open list:TARGET SUBSYSTEM, open list
  Cc: Joern Engel, Spencer Baugh, Roland Dreier, Spencer Baugh

From: Roland Dreier <roland@purestorage.com>

Solaris seems to go beserk if we respond to REPORT LUNS with a
LUN LIST LENGTH of 0.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Spencer Baugh <sbaugh@catern.com>
---
 drivers/target/target_core_spc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c
index 87d4adb..d8a32e5 100644
--- a/drivers/target/target_core_spc.c
+++ b/drivers/target/target_core_spc.c
@@ -1241,6 +1241,13 @@ sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd)
 	 * See SPC3 r07, page 159.
 	 */
 done:
+	/*
+	 * If no real LUNs are accessible, report an allocation length
+	 * of 1 LUN to account for virtual LUN 0.
+	 */
+	if (lun_count == 0)
+		lun_count = 1;
+
 	lun_count *= 8;
 	buf[0] = ((lun_count >> 24) & 0xff);
 	buf[1] = ((lun_count >> 16) & 0xff);
-- 
2.5.0.rc3


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

* Re: [PATCH] target: respond to unknown initiators with sensible REPORT LUNS list length
  2015-07-22 22:08 [PATCH] target: respond to unknown initiators with sensible REPORT LUNS list length Spencer Baugh
@ 2015-07-23  9:41 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2015-07-23  9:41 UTC (permalink / raw)
  To: Spencer Baugh
  Cc: Nicholas A. Bellinger, open list:TARGET SUBSYSTEM,
	open list:TARGET SUBSYSTEM, open list, Joern Engel,
	Spencer Baugh, Roland Dreier

On Wed, Jul 22, 2015 at 03:08:17PM -0700, Spencer Baugh wrote:
>  done:
> +	/*
> +	 * If no real LUNs are accessible, report an allocation length
> +	 * of 1 LUN to account for virtual LUN 0.
> +	 */
> +	if (lun_count == 0)
> +		lun_count = 1;
> +

Shouldn't the code actually report the virtual lun zero instead of just
accounting for it?

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

end of thread, other threads:[~2015-07-23  9:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-22 22:08 [PATCH] target: respond to unknown initiators with sensible REPORT LUNS list length Spencer Baugh
2015-07-23  9:41 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).