Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: don't create a multipath node for zero capacity devices
@ 2024-04-03 12:47 Christoph Hellwig
  2024-04-03 13:40 ` Nilay Shroff
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Christoph Hellwig @ 2024-04-03 12:47 UTC (permalink / raw)
  To: kbusch, sagi; +Cc: linux-nvme, Nilay Shroff

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);
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme: don't create a multipath node for zero capacity devices
  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
  2024-04-03 22:21 ` Chaitanya Kulkarni
  2024-04-04 15:58 ` Keith Busch
  2 siblings, 0 replies; 4+ messages in thread
From: Nilay Shroff @ 2024-04-03 13:40 UTC (permalink / raw)
  To: Christoph Hellwig, kbusch, sagi; +Cc: linux-nvme, Gregory Joyce



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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme: don't create a multipath node for zero capacity devices
  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
@ 2024-04-03 22:21 ` Chaitanya Kulkarni
  2024-04-04 15:58 ` Keith Busch
  2 siblings, 0 replies; 4+ messages in thread
From: Chaitanya Kulkarni @ 2024-04-03 22:21 UTC (permalink / raw)
  To: Christoph Hellwig, kbusch@kernel.org, sagi@grimberg.me
  Cc: linux-nvme@lists.infradead.org, Nilay Shroff

On 4/3/24 05:47, 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(-)

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme: don't create a multipath node for zero capacity devices
  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
  2024-04-03 22:21 ` Chaitanya Kulkarni
@ 2024-04-04 15:58 ` Keith Busch
  2 siblings, 0 replies; 4+ messages in thread
From: Keith Busch @ 2024-04-04 15:58 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: sagi, linux-nvme, Nilay Shroff

On Wed, Apr 03, 2024 at 02:47:17PM +0200, 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.

Thanks, applied to nvme-6.9.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-04 15:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2024-04-03 22:21 ` Chaitanya Kulkarni
2024-04-04 15:58 ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox