Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 May 2017 12:02:51 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r318942 - vendor-sys/illumos/dist/uts/common/fs/zfs
Message-ID:  <201705261202.v4QC2pcU093159@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Fri May 26 12:02:51 2017
New Revision: 318942
URL: https://svnweb.freebsd.org/changeset/base/318942

Log:
  8166 zpool scrub thinks it repaired offline device
  
  illumos/illumos-gate@2d2f193a21231a58c583466dc23ba71f1a25f424
  https://github.com/illumos/illumos-gate/commit/2d2f193a21231a58c583466dc23ba71f1a25f424
  
  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
  
  Reviewed by: George Wilson george.wilson@delphix.com
  Reviewed by: Brad Lewis <brad.lewis@delphix.com>
  Approved by: Richard Lowe <richlowe@richlowe.net>
  Author: Matthew Ahrens <mahrens@delphix.com>

Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c
==============================================================================
--- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c	Fri May 26 12:02:14 2017	(r318941)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c	Fri May 26 12:02:51 2017	(r318942)
@@ -1788,6 +1788,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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705261202.v4QC2pcU093159>