Skip to content

Commit

Permalink
FreeBSD rS271776 - Persist vdev_resilver_txg changes
Browse files Browse the repository at this point in the history
Persist vdev_resilver_txg changes to avoid panic caused by validation
vs a vdev_resilver_txg value from a previous resilver.

Authored-by: smh <[email protected]>
Ported-by: Chris Dunlop <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>

OpenZFS-issue: https://www.illumos.org/issues/5154
FreeBSD-issue: https://reviews.freebsd.org/rS271776
FreeBSD-commit: freebsd/freebsd-src@c3c60bf
Closes openzfs#4790
  • Loading branch information
smh authored and unset committed Oct 19, 2016
1 parent fc1501d commit b9a9b4d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions module/zfs/vdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1910,12 +1910,15 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t txg, uint64_t scrub_txg, int scrub_done)

/*
* If the vdev was resilvering and no longer has any
* DTLs then reset its resilvering flag.
* DTLs then reset its resilvering flag and dirty
* the top level so that we persist the change.
*/
if (vd->vdev_resilver_txg != 0 &&
range_tree_space(vd->vdev_dtl[DTL_MISSING]) == 0 &&
range_tree_space(vd->vdev_dtl[DTL_OUTAGE]) == 0)
range_tree_space(vd->vdev_dtl[DTL_OUTAGE]) == 0) {
vd->vdev_resilver_txg = 0;
vdev_config_dirty(vd->vdev_top);
}

mutex_exit(&vd->vdev_dtl_lock);

Expand Down

0 comments on commit b9a9b4d

Please sign in to comment.