]> git.proxmox.com Git - mirror_zfs.git/commitdiff
FreeBSD rS271776 - Persist vdev_resilver_txg changes
authorsmh <smh@FreeBSD.org>
Thu, 23 Jun 2016 14:45:19 +0000 (00:45 +1000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 24 Jun 2016 20:02:42 +0000 (13:02 -0700)
Persist vdev_resilver_txg changes to avoid panic caused by validation
vs a vdev_resilver_txg value from a previous resilver.

Authored-by: smh <smh@FreeBSD.org>
Ported-by: Chris Dunlop <chris@onthe.net.au>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
OpenZFS-issue: https://www.illumos.org/issues/5154
FreeBSD-issue: https://reviews.freebsd.org/rS271776
FreeBSD-commit: https://github.com/freebsd/freebsd/commit/c3c60bf
Closes #4790

module/zfs/vdev.c

index 607be3ce3b81a0eecf6deb9e6fe3daa706c62d94..fb0a2c31f50d8f2477580a92c3b355e9fabd18bb 100644 (file)
@@ -1909,12 +1909,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);