Skip to content

Commit

Permalink
Cancel in-progress rebuilds when we finish removal
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pcd1193182 authored and andrewc12 committed Sep 23, 2022
1 parent 4afb6b2 commit debfa18
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions module/zfs/vdev_removal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,8 @@ vdev_remove_complete(spa_t *spa)
ASSERT3P(vd->vdev_initialize_thread, ==, NULL);
ASSERT3P(vd->vdev_trim_thread, ==, NULL);
ASSERT3P(vd->vdev_autotrim_thread, ==, NULL);
vdev_rebuild_stop_wait(vd);
ASSERT3P(vd->vdev_rebuild_thread, ==, NULL);
uint64_t vdev_space = spa_deflate(spa) ?
vd->vdev_stat.vs_dspace : vd->vdev_stat.vs_space;

Expand Down

0 comments on commit debfa18

Please sign in to comment.