All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Gurtovoy <maxg@mellanox.com>
To: Keith Busch <keith.busch@intel.com>,
	Linux NVMe <linux-nvme@lists.infradead.org>,
	Christoph Hellwig <hch@lst.de>,
	"Sagi Grimberg" <sagi@grimberg.me>
Cc: <stable@vger.kernel.org>
Subject: Re: [PATCH] nvme: Skip checking heads without namespaces
Date: Tue, 20 Mar 2018 14:56:19 +0200	[thread overview]
Message-ID: <79a25da6-baa1-7f8d-825d-41202bd440aa@mellanox.com> (raw)
In-Reply-To: <20180319165350.9879-1-keith.busch@intel.com>



On 3/19/2018 6:53 PM, Keith Busch wrote:
> If a task is holding a reference to a namespace on a removed controller,
> the head will not be released. If the same controller is added again
> later, its namespaces may not be successfully added. Instead, the user
> will see kernel message "Duplicate IDs for nsid <X>".
> 
> This patch fixes that by skipping heads that don't have namespaces when
> considering if a new namespace is safe to add.
> 
> Reported-by: Alex Gagniuc <Alex_Gagniuc@Dellteam.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Keith Busch <keith.busch@intel.com>
> ---
>   drivers/nvme/host/core.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 7aeca5db7916..0b9e60861e53 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -2793,6 +2793,7 @@ static int __nvme_check_ids(struct nvme_subsystem *subsys,
>   
>   	list_for_each_entry(h, &subsys->nsheads, entry) {
>   		if (nvme_ns_ids_valid(&new->ids) &&
> +		    !list_empty(&h->list) &&
>   		    nvme_ns_ids_equal(&new->ids, &h->ids))
>   			return -EINVAL;
>   	}
> 

Looks good,

Reviewed-by: Max Gurtovoy <maxg@mellanox.com>

WARNING: multiple messages have this Message-ID (diff)
From: maxg@mellanox.com (Max Gurtovoy)
Subject: [PATCH] nvme: Skip checking heads without namespaces
Date: Tue, 20 Mar 2018 14:56:19 +0200	[thread overview]
Message-ID: <79a25da6-baa1-7f8d-825d-41202bd440aa@mellanox.com> (raw)
In-Reply-To: <20180319165350.9879-1-keith.busch@intel.com>



On 3/19/2018 6:53 PM, Keith Busch wrote:
> If a task is holding a reference to a namespace on a removed controller,
> the head will not be released. If the same controller is added again
> later, its namespaces may not be successfully added. Instead, the user
> will see kernel message "Duplicate IDs for nsid <X>".
> 
> This patch fixes that by skipping heads that don't have namespaces when
> considering if a new namespace is safe to add.
> 
> Reported-by: Alex Gagniuc <Alex_Gagniuc at Dellteam.com>
> Cc: stable at vger.kernel.org
> Signed-off-by: Keith Busch <keith.busch at intel.com>
> ---
>   drivers/nvme/host/core.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 7aeca5db7916..0b9e60861e53 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -2793,6 +2793,7 @@ static int __nvme_check_ids(struct nvme_subsystem *subsys,
>   
>   	list_for_each_entry(h, &subsys->nsheads, entry) {
>   		if (nvme_ns_ids_valid(&new->ids) &&
> +		    !list_empty(&h->list) &&
>   		    nvme_ns_ids_equal(&new->ids, &h->ids))
>   			return -EINVAL;
>   	}
> 

Looks good,

Reviewed-by: Max Gurtovoy <maxg at mellanox.com>

  parent reply	other threads:[~2018-03-20 12:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-19 16:53 [PATCH] nvme: Skip checking heads without namespaces Keith Busch
2018-03-19 16:53 ` Keith Busch
2018-03-20  8:48 ` Christoph Hellwig
2018-03-20  8:48   ` Christoph Hellwig
2018-03-20 12:56 ` Max Gurtovoy [this message]
2018-03-20 12:56   ` Max Gurtovoy
2018-03-20 17:50   ` Keith Busch
2018-03-20 17:50     ` Keith Busch

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=79a25da6-baa1-7f8d-825d-41202bd440aa@mellanox.com \
    --to=maxg@mellanox.com \
    --cc=hch@lst.de \
    --cc=keith.busch@intel.com \
    --cc=linux-nvme@lists.infradead.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.