From: Spencer Baugh <sbaugh@catern.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>,
linux-scsi@vger.kernel.org (open list:TARGET SUBSYSTEM),
target-devel@vger.kernel.org (open list:TARGET SUBSYSTEM),
linux-kernel@vger.kernel.org (open list)
Cc: Joern Engel <joern@purestorage.com>,
Spencer Baugh <Spencer.baugh@purestorage.com>,
Roland Dreier <roland@purestorage.com>,
Spencer Baugh <sbaugh@catern.com>
Subject: [PATCH] target: respond to unknown initiators with sensible REPORT LUNS list length
Date: Wed, 22 Jul 2015 15:08:17 -0700 [thread overview]
Message-ID: <1437602898-15229-3-git-send-email-sbaugh@catern.com> (raw)
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
next reply other threads:[~2015-07-22 22:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-22 22:08 Spencer Baugh [this message]
2015-07-23 9:41 ` [PATCH] target: respond to unknown initiators with sensible REPORT LUNS list length Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1437602898-15229-3-git-send-email-sbaugh@catern.com \
--to=sbaugh@catern.com \
--cc=Spencer.baugh@purestorage.com \
--cc=joern@purestorage.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=nab@linux-iscsi.org \
--cc=roland@purestorage.com \
--cc=target-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox