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 <paul.dagnelie@klarasystems.com>
Co-authored-by: Paul Dagnelie <paul.dagnelie@klarasystems.com>

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
This commit is contained in:
Paul Dagnelie 2025-04-02 12:11:33 -07:00 committed by Tony Hutter
parent 5fb1d520fe
commit bd5465e4eb

View File

@ -1939,14 +1939,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);
}
}
/*