Commit 0551ec93 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Keith Busch

nvme: don't create a multipath node for zero capacity devices

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: 46e7422c ("nvme: move common logic into nvme_update_ns_info")
Reported-by: default avatarNilay Shroff <nilay@linux.ibm.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Tested-by: default avatarNilay Shroff <nilay@linux.ibm.com>
Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent c85c9ab9
...@@ -2089,7 +2089,7 @@ static int nvme_update_ns_info_block(struct nvme_ns *ns, ...@@ -2089,7 +2089,7 @@ static int nvme_update_ns_info_block(struct nvme_ns *ns,
if (id->ncap == 0) { if (id->ncap == 0) {
/* namespace not allocated or attached */ /* namespace not allocated or attached */
info->is_removed = true; info->is_removed = true;
ret = -ENODEV; ret = -ENXIO;
goto out; goto out;
} }
lbaf = nvme_lbaf_index(id->flbas); lbaf = nvme_lbaf_index(id->flbas);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment