Persist vdev_resilver_txg changes to avoid panic caused by validation

vs a vdev_resilver_txg value from a previous resilver.

MFC after:	1 week
This commit is contained in:
Steven Hartland 2014-09-11 16:21:51 +00:00
parent 343e440f63
commit 3cdd9138c3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271429

View File

@ -1951,12 +1951,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);