From 7be9fa259ed711c3b5adde783b85c92caa54007e Mon Sep 17 00:00:00 2001 From: Paul Dagnelie Date: Wed, 2 Apr 2025 12:11:33 -0700 Subject: [PATCH] Fix nonrot property being incorrectly unset (#17206) When opening a vdev and setting the nonrot property, we used to wait for each child to be opened before examining its nonrot property. When the change was made to open vdevs asynchronously, we didn't move the nonrot check out of the main loop. As a result, the nonrot property is almost always set to false, regardless of the actual type of the underlying disks. The fix is simply to move the nonrot check to a separate loop after the taskq has been waited for. Sponsored-by: Klara, Inc. Sponsored-by: Eshtek, Inc. Signed-off-by: Paul Dagnelie Co-authored-by: Paul Dagnelie Reviewed-by: Tony Hutter Reviewed-by: Alexander Motin --- module/zfs/vdev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c index 257ac2b9d..9ac9a9fe6 100644 --- a/module/zfs/vdev.c +++ b/module/zfs/vdev.c @@ -1938,14 +1938,17 @@ vdev_open_children_impl(vdev_t *vd, vdev_open_children_func_t *open_func) VERIFY(taskq_dispatch(tq, vdev_open_child, cvd, TQ_SLEEP) != TASKQID_INVALID); } + } + if (tq != NULL) + taskq_wait(tq); + for (int c = 0; c < children; c++) { + vdev_t *cvd = vd->vdev_child[c]; vd->vdev_nonrot &= cvd->vdev_nonrot; } - if (tq != NULL) { - taskq_wait(tq); + if (tq != NULL) taskq_destroy(tq); - } } /*