nvme: catch -ENODEV from nvme_revalidate_zones again
nvme_revalidate_zones can also return -ENODEV if e.g. zone sizes aren't
constant or not a power of two. In that case we should jump to marking
the gendisk hidden and only support pass through.
Fixes: 602e57c979
("nvme: also mark passthrough-only namespaces ready in nvme_update_ns_info")
Reported-by: Joel Granados <j.granados@samsung.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Joel Granados <j.granados@samsung.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
4cf42ec366
commit
e06b425bc8
1 changed files with 7 additions and 6 deletions
|
@ -1940,8 +1940,10 @@ static int nvme_update_ns_info(struct nvme_ns *ns, struct nvme_id_ns *id)
|
||||||
|
|
||||||
if (ns->head->ids.csi == NVME_CSI_ZNS) {
|
if (ns->head->ids.csi == NVME_CSI_ZNS) {
|
||||||
ret = nvme_update_zone_info(ns, lbaf);
|
ret = nvme_update_zone_info(ns, lbaf);
|
||||||
if (ret)
|
if (ret) {
|
||||||
goto out_unfreeze;
|
blk_mq_unfreeze_queue(ns->disk->queue);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
set_disk_ro(ns->disk, (id->nsattr & NVME_NS_ATTR_RO) ||
|
set_disk_ro(ns->disk, (id->nsattr & NVME_NS_ATTR_RO) ||
|
||||||
|
@ -1952,7 +1954,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))
|
||||||
return ret;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nvme_ns_head_multipath(ns->head)) {
|
if (nvme_ns_head_multipath(ns->head)) {
|
||||||
|
@ -1967,9 +1969,9 @@ static int nvme_update_ns_info(struct nvme_ns *ns, struct nvme_id_ns *id)
|
||||||
disk_update_readahead(ns->head->disk);
|
disk_update_readahead(ns->head->disk);
|
||||||
blk_mq_unfreeze_queue(ns->head->disk->queue);
|
blk_mq_unfreeze_queue(ns->head->disk->queue);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
|
|
||||||
out_unfreeze:
|
ret = 0;
|
||||||
|
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.
|
||||||
|
@ -1979,7 +1981,6 @@ out_unfreeze:
|
||||||
set_bit(NVME_NS_READY, &ns->flags);
|
set_bit(NVME_NS_READY, &ns->flags);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
blk_mq_unfreeze_queue(ns->disk->queue);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue