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 GitHub
parent 5b0c27cd14
commit 7be9fa259e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
}
}
/*