summaryrefslogtreecommitdiff
path: root/drivers/nvme/host
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-09-28 12:30:16 +0200
committerChristoph Hellwig <hch@lst.de>2020-10-07 07:56:19 +0200
commit3a9967ba7ace91153f9caa8e60a55c7668c7b946 (patch)
tree66693ce746ab28c086d5585cf5fd6bcd6ac1fec9 /drivers/nvme/host
parentaf0f446d2cad06bd678e9b912f7653b63d87fd6b (diff)
nvme: revalidate zone bitmaps in nvme_update_ns_info
Consolidate the two calls into a single place. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'drivers/nvme/host')
-rw-r--r--drivers/nvme/host/core.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index f19f6c7c5b12..9c137d8819f7 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2150,6 +2150,12 @@ static int nvme_update_ns_info(struct nvme_ns *ns, struct nvme_id_ns *id)
nvme_update_disk_info(ns->disk, ns, id);
blk_mq_unfreeze_queue(ns->disk->queue);
+ if (blk_queue_is_zoned(ns->queue)) {
+ ret = nvme_revalidate_zones(ns);
+ if (ret)
+ return ret;
+ }
+
#ifdef CONFIG_NVME_MULTIPATH
if (ns->head->disk) {
blk_mq_freeze_queue(ns->head->disk->queue);
@@ -3915,8 +3921,6 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
if (nvme_update_ns_info(ns, id))
goto out_put_disk;
- if (blk_queue_is_zoned(ns->queue) && nvme_revalidate_zones(ns))
- goto out_put_disk;
if ((ctrl->quirks & NVME_QUIRK_LIGHTNVM) && id->vs[0] == 0x1) {
ret = nvme_nvm_register(ns, disk_name, node);
@@ -4012,8 +4016,6 @@ static void nvme_validate_or_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
}
ret = nvme_validate_ns(ns);
- if (!ret && blk_queue_is_zoned(ns->queue))
- ret = nvme_revalidate_zones(ns);
revalidate_disk_size(ns->disk, ret == 0);
if (ret)
nvme_ns_remove(ns);