@@ -2001,7 +2001,7 @@ static void nvme_update_disk_info(struct gendisk *disk,
/* unsupported block size, set capacity to 0 later */
bs = (1 << 9);
}
- blk_mq_freeze_queue(disk->queue);
+
blk_integrity_unregister(disk);
atomic_bs = phys_bs = bs;
@@ -2066,8 +2066,6 @@ static void nvme_update_disk_info(struct gendisk *disk,
set_disk_ro(disk, true);
else
set_disk_ro(disk, false);
-
- blk_mq_unfreeze_queue(disk->queue);
}
static inline bool nvme_first_scan(struct gendisk *disk)
@@ -2114,6 +2112,7 @@ static int __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
struct nvme_ctrl *ctrl = ns->ctrl;
int ret;
+ blk_mq_freeze_queue(ns->disk->queue);
/*
* If identify namespace failed, use default 512 byte block size so
* block layer can use before failing read/write for 0 capacity.
@@ -2131,29 +2130,38 @@ static int __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
dev_warn(ctrl->device,
"failed to add zoned namespace:%u ret:%d\n",
ns->head->ns_id, ret);
- return ret;
+ goto out_unfreeze;
}
break;
default:
dev_warn(ctrl->device, "unknown csi:%u ns:%u\n",
ns->head->ids.csi, ns->head->ns_id);
- return -ENODEV;
+ ret = -ENODEV;
+ goto out_unfreeze;
}
ret = nvme_configure_metadata(ns, id);
if (ret)
- return ret;
+ goto out_unfreeze;
nvme_set_chunk_sectors(ns, id);
nvme_update_disk_info(disk, ns, id);
+ blk_mq_unfreeze_queue(ns->disk->queue);
+
#ifdef CONFIG_NVME_MULTIPATH
if (ns->head->disk) {
+ blk_mq_freeze_queue(ns->head->disk->queue);
nvme_update_disk_info(ns->head->disk, ns, id);
blk_stack_limits(&ns->head->disk->queue->limits,
&ns->queue->limits, 0);
nvme_mpath_update_disk_size(ns->head->disk);
+ blk_mq_unfreeze_queue(ns->head->disk->queue);
}
#endif
return 0;
+
+out_unfreeze:
+ blk_mq_unfreeze_queue(ns->disk->queue);
+ return ret;
}
static int _nvme_revalidate_disk(struct gendisk *disk)