Commit 602e57c9 authored by Christoph Hellwig's avatar Christoph Hellwig

nvme: also mark passthrough-only namespaces ready in nvme_update_ns_info

Commit e7d65803 ("nvme-multipath: revalidate paths during rescan")
introduced the NVME_NS_READY flag, which nvme_path_is_disabled() uses
to check if a path can be used or not.  We also need to set this flag
for devices that fail the ZNS feature validation and which are available
through passthrough devices only to that they can be used in multipathing
setups.

Fixes: e7d65803 ("nvme-multipath: revalidate paths during rescan")
Reported-by: default avatarKanchan Joshi <joshi.k@samsung.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarDaniel Wagner <dwagner@suse.de>
Tested-by: default avatarKanchan Joshi <joshi.k@samsung.com>
parent 363f6368
...@@ -1931,7 +1931,7 @@ static int nvme_update_ns_info(struct nvme_ns *ns, struct nvme_id_ns *id) ...@@ -1931,7 +1931,7 @@ static int nvme_update_ns_info(struct nvme_ns *ns, struct nvme_id_ns *id)
if (blk_queue_is_zoned(ns->queue)) { if (blk_queue_is_zoned(ns->queue)) {
ret = nvme_revalidate_zones(ns); ret = nvme_revalidate_zones(ns);
if (ret && !nvme_first_scan(ns->disk)) if (ret && !nvme_first_scan(ns->disk))
goto out; return ret;
} }
if (nvme_ns_head_multipath(ns->head)) { if (nvme_ns_head_multipath(ns->head)) {
...@@ -1946,16 +1946,16 @@ static int nvme_update_ns_info(struct nvme_ns *ns, struct nvme_id_ns *id) ...@@ -1946,16 +1946,16 @@ static int nvme_update_ns_info(struct nvme_ns *ns, struct nvme_id_ns *id)
return 0; return 0;
out_unfreeze: out_unfreeze:
blk_mq_unfreeze_queue(ns->disk->queue);
out:
/* /*
* If probing fails due an unsupported feature, hide the block device, * If probing fails due an unsupported feature, hide the block device,
* but still allow other access. * but still allow other access.
*/ */
if (ret == -ENODEV) { if (ret == -ENODEV) {
ns->disk->flags |= GENHD_FL_HIDDEN; ns->disk->flags |= GENHD_FL_HIDDEN;
set_bit(NVME_NS_READY, &ns->flags);
ret = 0; ret = 0;
} }
blk_mq_unfreeze_queue(ns->disk->queue);
return ret; return ret;
} }
......
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