Skip to content

Commit 602e57c

Browse files
author
Christoph Hellwig
committed
nvme: also mark passthrough-only namespaces ready in nvme_update_ns_info
Commit e7d6580 ("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: e7d6580 ("nvme-multipath: revalidate paths during rescan") Reported-by: Kanchan Joshi <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Daniel Wagner <[email protected]> Tested-by: Kanchan Joshi <[email protected]>
1 parent 363f636 commit 602e57c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/nvme/host/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,7 +1931,7 @@ static int nvme_update_ns_info(struct nvme_ns *ns, struct nvme_id_ns *id)
19311931
if (blk_queue_is_zoned(ns->queue)) {
19321932
ret = nvme_revalidate_zones(ns);
19331933
if (ret && !nvme_first_scan(ns->disk))
1934-
goto out;
1934+
return ret;
19351935
}
19361936

19371937
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)
19461946
return 0;
19471947

19481948
out_unfreeze:
1949-
blk_mq_unfreeze_queue(ns->disk->queue);
1950-
out:
19511949
/*
19521950
* If probing fails due an unsupported feature, hide the block device,
19531951
* but still allow other access.
19541952
*/
19551953
if (ret == -ENODEV) {
19561954
ns->disk->flags |= GENHD_FL_HIDDEN;
1955+
set_bit(NVME_NS_READY, &ns->flags);
19571956
ret = 0;
19581957
}
1958+
blk_mq_unfreeze_queue(ns->disk->queue);
19591959
return ret;
19601960
}
19611961

0 commit comments

Comments
 (0)