On Sat, Feb 06, 2021 at 01:07:57AM +0900, Minwoo Im wrote: > If multipath is enabled, the namespace head and hidden namespace will be > created. In this case, /sys/block/nvme0n1/queue/nr_zones are not > returning proper value for the namespace itself. By the way, the hidden > namespace /sys/block/nvme0c0n1/queue/nr_zones are returning properly. > > Is it okay for sysfs of the head namespace node (nvme0n1) not to manage > the request queue attributes like nr_zones?
This should fix it. Untested, as my dev machine is in need of repair, but if someone can confirm this is successful, I can send it to the kernel list. --- diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index 65bd6efa5e1c..eb18949bb999 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -677,6 +677,8 @@ void nvme_mpath_add_disk(struct nvme_ns *ns, struct nvme_id_ns *id) if (blk_queue_stable_writes(ns->queue) && ns->head->disk) blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, ns->head->disk->queue); + if (blk_queue_is_zoned(ns->queue)) + blk_revalidate_disk_zones(ns->head->disk, NULL); } void nvme_mpath_remove_disk(struct nvme_ns_head *head) --