Skip to content

Commit af1b2e8

Browse files
pcd1193182FedorUporovVstack
authored andcommitted
Fix nonrot property being incorrectly unset (openzfs#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 <[email protected]> Co-authored-by: Paul Dagnelie <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Alexander Motin <[email protected]>
1 parent 6b13053 commit af1b2e8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

module/zfs/vdev.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,14 +1938,17 @@ vdev_open_children_impl(vdev_t *vd, vdev_open_children_func_t *open_func)
19381938
VERIFY(taskq_dispatch(tq, vdev_open_child,
19391939
cvd, TQ_SLEEP) != TASKQID_INVALID);
19401940
}
1941+
}
19411942

1943+
if (tq != NULL)
1944+
taskq_wait(tq);
1945+
for (int c = 0; c < children; c++) {
1946+
vdev_t *cvd = vd->vdev_child[c];
19421947
vd->vdev_nonrot &= cvd->vdev_nonrot;
19431948
}
19441949

1945-
if (tq != NULL) {
1946-
taskq_wait(tq);
1950+
if (tq != NULL)
19471951
taskq_destroy(tq);
1948-
}
19491952
}
19501953

19511954
/*

0 commit comments

Comments
 (0)