Skip to content

Commit 1ae3a4e

Browse files
pcd1193182andrewc12
authored andcommitted
Cancel in-progress rebuilds when we finish removal
This issue was discovered by zloop runs. When a mirror or other redundant top-level vdev has a disk failure, and the disk is replaced, the rebuild process occurs. A removal can happen while this is in progress. If the removal completes before the rebuild does, the removal process will try to free the vdev that is still in use. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Paul Dagnelie <[email protected]> Closes openzfs#13498
1 parent 0ef466d commit 1ae3a4e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

module/zfs/vdev_removal.c

+2
Original file line numberDiff line numberDiff line change
@@ -1364,6 +1364,8 @@ vdev_remove_complete(spa_t *spa)
13641364
ASSERT3P(vd->vdev_initialize_thread, ==, NULL);
13651365
ASSERT3P(vd->vdev_trim_thread, ==, NULL);
13661366
ASSERT3P(vd->vdev_autotrim_thread, ==, NULL);
1367+
vdev_rebuild_stop_wait(vd);
1368+
ASSERT3P(vd->vdev_rebuild_thread, ==, NULL);
13671369
uint64_t vdev_space = spa_deflate(spa) ?
13681370
vd->vdev_stat.vs_dspace : vd->vdev_stat.vs_space;
13691371

0 commit comments

Comments
 (0)