From: Greg KH <greg@kroah.com>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: stable@vger.kernel.org
Subject: Re: [PATCH stable 4.18+] nvme: Treat discovery subsystems as unique subsystems
Date: Tue, 14 Apr 2020 13:34:56 +0200 [thread overview]
Message-ID: <20200414113456.GA441876@kroah.com> (raw)
In-Reply-To: <20200413081349.16278-1-sagi@grimberg.me>
On Mon, Apr 13, 2020 at 01:13:49AM -0700, Sagi Grimberg wrote:
> From: James Smart <jsmart2021@gmail.com>
>
> [ Upstream commit c26aa572027d438de9cc311aaebcbe972f698c24 ]
>
> Current code matches subnqn and collapses all controllers to the
> same subnqn to a single subsystem structure. This is good for
> recognizing multiple controllers for the same subsystem. But with
> the well-known discovery subnqn, the subsystems aren't truly the
> same subsystem. As such, subsystem specific rules, such as no
> overlap of controller id, do not apply. With today's behavior, the
> check for overlap of controller id can fail, preventing the new
> discovery controller from being created.
>
> When searching for like subsystem nqn, exclude the discovery nqn
> from matching. This will result in each discovery controller being
> attached to a unique subsystem structure.
>
> Signed-off-by: James Smart <jsmart2021@gmail.com>
> Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
> ---
> drivers/nvme/host/core.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index fad04282148d..0545eb97d838 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -2374,6 +2374,17 @@ static struct nvme_subsystem *__nvme_find_get_subsystem(const char *subsysnqn)
>
> lockdep_assert_held(&nvme_subsystems_lock);
>
> + /*
> + * Fail matches for discovery subsystems. This results
> + * in each discovery controller bound to a unique subsystem.
> + * This avoids issues with validating controller values
> + * that can only be true when there is a single unique subsystem.
> + * There may be multiple and completely independent entities
> + * that provide discovery controllers.
> + */
> + if (!strcmp(subsysnqn, NVME_DISC_SUBSYS_NAME))
> + return NULL;
> +
> list_for_each_entry(subsys, &nvme_subsystems, entry) {
> if (strcmp(subsys->subnqn, subsysnqn))
> continue;
> --
> 2.20.1
>
Now queued up, thanks.
greg k-h
prev parent reply other threads:[~2020-04-14 11:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-13 8:13 [PATCH stable 4.18+] nvme: Treat discovery subsystems as unique subsystems Sagi Grimberg
2020-04-14 11:34 ` Greg KH [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=20200414113456.GA441876@kroah.com \
--to=greg@kroah.com \
--cc=sagi@grimberg.me \
--cc=stable@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).