Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nilay Shroff <nilay@linux.ibm.com>
To: Christoph Hellwig <hch@lst.de>, kbusch@kernel.org, sagi@grimberg.me
Cc: linux-nvme@lists.infradead.org, Gregory Joyce <gjoyce@ibm.com>
Subject: Re: [PATCH] nvme: don't create a multipath node for zero capacity devices
Date: Wed, 3 Apr 2024 19:10:01 +0530	[thread overview]
Message-ID: <77737b7f-8056-4e6f-861e-97e7834ff741@linux.ibm.com> (raw)
In-Reply-To: <20240403124717.931577-1-hch@lst.de>



On 4/3/24 18:17, Christoph Hellwig wrote:
> Apparently there are nvme controllers around that report namespaces
> in the namespace list which have zero capacity.  Return -ENXIO instead
> of -ENODEV from nvme_update_ns_info_block so we don't create a hidden
> multipath node for these namespaces but entirely ignore them.
> 
> Fixes: 46e7422cda84 ("nvme: move common logic into nvme_update_ns_info")
> Reported-by: Nilay Shroff <nilay@linux.ibm.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  drivers/nvme/host/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 3b0498f320e6b9..ad60cf5581a419 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -2089,7 +2089,7 @@ static int nvme_update_ns_info_block(struct nvme_ns *ns,
>  	if (id->ncap == 0) {
>  		/* namespace not allocated or attached */
>  		info->is_removed = true;
> -		ret = -ENODEV;
> +		ret = -ENXIO;
>  		goto out;
>  	}
>  	lbaf = nvme_lbaf_index(id->flbas);
I have tested patch on my controller with zero capacity namespaces.
This looks good and fixing the issue reported here: 
https://lore.kernel.org/all/c0750d96-6bae-46b5-a1cc-2ff9d36eccb3@linux.ibm.com/

Tested-by: Nilay Shroff <nilay@linux.ibm.com>

Thanks,
--Nilay


  reply	other threads:[~2024-04-03 13:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03 12:47 [PATCH] nvme: don't create a multipath node for zero capacity devices Christoph Hellwig
2024-04-03 13:40 ` Nilay Shroff [this message]
2024-04-03 22:21 ` Chaitanya Kulkarni
2024-04-04 15:58 ` 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=77737b7f-8056-4e6f-861e-97e7834ff741@linux.ibm.com \
    --to=nilay@linux.ibm.com \
    --cc=gjoyce@ibm.com \
    --cc=hch@lst.de \
    --cc=kbusch@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