Skip to content

Commit

Permalink
nvme: don't create a multipath node for zero capacity devices
Browse files Browse the repository at this point in the history
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: 46e7422 ("nvme: move common logic into nvme_update_ns_info")
Reported-by: Nilay Shroff <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Tested-by: Nilay Shroff <[email protected]>
Reviewed-by: Chaitanya Kulkarni <[email protected]>
Signed-off-by: Keith Busch <[email protected]>
  • Loading branch information
Christoph Hellwig authored and keithbusch committed Apr 4, 2024
1 parent c85c9ab commit 0551ec9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvme/host/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0551ec9

Please sign in to comment.