Skip to content

Commit

Permalink
8166 zpool scrub thinks it repaired offline device
Browse files Browse the repository at this point in the history
illumos/illumos-gate@2d2f193
illumos/illumos-gate@2d2f193

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 openzfs/zfs#5806

Reviewed by: George Wilson [email protected]
Reviewed by: Brad Lewis <[email protected]>
Approved by: Richard Lowe <[email protected]>
Author: Matthew Ahrens <[email protected]>


git-svn-id: https://svn.freebsd.org/base/vendor-sys/illumos/dist@318942 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
  • Loading branch information
avg committed May 26, 2017
1 parent 5d9dbca commit b82f967
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions uts/common/fs/zfs/vdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b82f967

Please sign in to comment.