From: Dmitry Bogdanov <d.bogdanov@yadro.com>
To: Mike Christie <michael.christie@oracle.com>
Cc: Martin Petersen <martin.petersen@oracle.com>,
<target-devel@vger.kernel.org>, <linux-scsi@vger.kernel.org>,
<linux@yadro.com>, Roman Bolshakov <r.bolshakov@yadro.com>
Subject: Re: [PATCH] scsi: target: core: Set MULTIP bit in INQUIRY
Date: Fri, 9 Sep 2022 11:30:42 +0300 [thread overview]
Message-ID: <20220909083042.GC9218@yadro.com> (raw)
In-Reply-To: <8b2da710-f878-7b80-a75a-6f7e95df3452@oracle.com>
On Wed, Sep 07, 2022 at 03:06:04PM -0500, Mike Christie wrote:
>
> On 9/6/22 2:48 AM, Dmitry Bogdanov wrote:
> >
> > diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c
> > index c14441c89bed..32fb38ce98f4 100644
> > --- a/drivers/target/target_core_spc.c
> > +++ b/drivers/target/target_core_spc.c
> > @@ -75,6 +75,8 @@ spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf)
> > struct se_portal_group *tpg = lun->lun_tpg;
> > struct se_device *dev = cmd->se_dev;
> > struct se_session *sess = cmd->se_sess;
> > + struct se_lun *tmp_lun;
> > + size_t dev_ports = 0;
> >
> > /* Set RMB (removable media) for tape devices */
> > if (dev->transport->get_device_type(dev) == TYPE_TAPE)
> > @@ -115,6 +117,20 @@ spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf)
> > buf[5] |= 0x1;
> > }
> >
> > + spin_lock(&dev->se_port_lock);
> > + list_for_each_entry(tmp_lun, &dev->dev_sep_list, lun_dev_link) {
> > + dev_ports++;
> > + /* Exact number of ports does not matter for MULTIP bit */
> > + if (dev_ports > 1)
> > + break;
>
> Can you just check se_deice->export_count instead of looping?
Yes, of course, dev->export_count exactly fits here.
>
> Also, setting the bit seems fine. I was just wondering what uses it?
There is no way to find it out. At least just to conform to the
standard. May be for some archaic users like AIX.
Btw, SCST reports MULTIP=1 always.
BR,
Dmitry
next prev parent reply other threads:[~2022-09-09 8:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-06 7:48 [PATCH] scsi: target: core: Set MULTIP bit in INQUIRY Dmitry Bogdanov
2022-09-07 20:06 ` Mike Christie
2022-09-09 8:30 ` Dmitry Bogdanov [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-04-20 0:18 Dmitry Bogdanov
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=20220909083042.GC9218@yadro.com \
--to=d.bogdanov@yadro.com \
--cc=linux-scsi@vger.kernel.org \
--cc=linux@yadro.com \
--cc=martin.petersen@oracle.com \
--cc=michael.christie@oracle.com \
--cc=r.bolshakov@yadro.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;
as well as URLs for NNTP newsgroup(s).