From: luanshi <zhangliguang@linux.alibaba.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@fb.com>,
Sagi Grimberg <sagi@grimberg.me>,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvme: duplicate NQNs check if devices needed
Date: Tue, 30 Nov 2021 14:58:16 +0800 [thread overview]
Message-ID: <59c28c51-5d73-398d-3e8d-3fb6bac89671@linux.alibaba.com> (raw)
In-Reply-To: <20211130064054.GB10268@lst.de>
Hi Christoph,
在 2021/11/30 14:40, Christoph Hellwig 写道:
> On Tue, Nov 30, 2021 at 01:04:55PM +0800, luanshi wrote:
>> Hi Keith,
>>
>> 在 2021/11/30 0:34, Keith Busch 写道:
>>> On Mon, Nov 29, 2021 at 07:18:54PM +0800, Liguang Zhang wrote:
>>>> @@ -2587,6 +2587,9 @@ static struct nvme_subsystem *__nvme_find_get_subsystem(const char *subsysnqn)
>>>> lockdep_assert_held(&nvme_subsystems_lock);
>>>> + if (strncmp(subsysnqn, "nqn.", 4))
>>>> + return NULL;
>>> This seems like an arbitrary way to decide not to check for duplicates.
>>> Shouldn't we just add the NVME_QUIRK_IGNORE_DEV_SUBNQN quirk for the
>>> broken controllers?
>> Yeah, add the NVME_QUIRK_IGNORE_DEV_SUBNQN quirk is a way to resolve the
>> problem. I do not
>>
>> have enough controller in my hand, I don't make sure all the controller are
>> covered. And there are some
> What does this broken device report in the subnqn field?
In function nvme_init_subnqn, i add some printk info,
#git diff drivers/nvme/host/core.c
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index e1e574ecf031..d043f4506c37 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2708,6 +2708,7 @@ static void nvme_init_subnqn(struct nvme_subsystem
*subsys, struct nvme_ctrl *ct
if(!(ctrl->quirks & NVME_QUIRK_IGNORE_DEV_SUBNQN)) {
nqnlen = strnlen(id->subnqn, NVMF_NQN_SIZE);
+ printk("%s: nqnlen=%d, subnqn=%s\n", __func__, nqnlen,
id->subnqn);
if (nqnlen > 0 && nqnlen < NVMF_NQN_SIZE) {
strlcpy(subsys->subnqn, id->subnqn, NVMF_NQN_SIZE);
return;
I found that:
nqnlen is 1, subnqn filed is filled by space.
nvme_init_subnqn: nqnlen=1 subnqn=
Thanks,
Liguang
prev parent reply other threads:[~2021-11-30 6:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-29 11:18 Liguang Zhang
2021-11-29 16:34 ` Keith Busch
2021-11-29 18:48 ` Chaitanya Kulkarni
2021-11-30 5:04 ` luanshi
2021-11-30 6:40 ` Christoph Hellwig
2021-11-30 6:58 ` luanshi [this message]
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=59c28c51-5d73-398d-3e8d-3fb6bac89671@linux.alibaba.com \
--to=zhangliguang@linux.alibaba.com \
--cc=axboe@fb.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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
all inboxes | Powered by JetHome®