svn commit: r319625 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Glen Barber
gjb at FreeBSD.org
Tue Jun 6 14:46:47 UTC 2017
Author: gjb
Date: Tue Jun 6 14:46:45 2017
New Revision: 319625
URL: https://svnweb.freebsd.org/changeset/base/319625
Log:
MFC r318943 (avg):
MFV r318942: 8166 zpool scrub thinks it repaired offline device
https://www.illumos.org/issues/8166
If we do a scrub while a leaf device is offline (via "zpool offline"),
we will inadvertently clear the DTL (dirty time log) of the offline
device, even though it is still damaged. When the device comes back
online, we will incompletely resilver it, thinking that the scrub
repaired blocks written before the scrub was started. The incomplete
resilver can lead to data loss if there is a subsequent failure of a
different leaf device.
The fix is to never clear the DTL of offline devices. Note that if a
device is onlined while a scrub is in progress, the scrub will be
restarted.
The problem can be worked around by running "zpool scrub" after
"zpool online".
See also https://github.com/zfsonlinux/zfs/issues/5806
PR: 219537
Sponsored by: The FreeBSD Foundation
Modified:
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Tue Jun 6 14:46:23 2017 (r319624)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Tue Jun 6 14:46:45 2017 (r319625)
@@ -1904,6 +1904,9 @@ vdev_dtl_should_excise(vdev_t *vd)
ASSERT0(scn->scn_phys.scn_errors);
ASSERT0(vd->vdev_children);
+ if (vd->vdev_state < VDEV_STATE_DEGRADED)
+ return (B_FALSE);
+
if (vd->vdev_resilver_txg == 0 ||
range_tree_space(vd->vdev_dtl[DTL_MISSING]) == 0)
return (B_TRUE);
More information about the svn-src-stable
mailing list