Print this page
3956 ::vdev -r should work with pipelines
3957 ztest should update the cachefile before killing itself
3958 multiple scans can lead to partial resilvering
3959 ddt entries are not always resilvered
3960 dsl_scan can skip over dedup-ed blocks if physical birth != logical birth
3961 freed gang blocks are not resilvered and can cause pool to suspend
3962 ztest should print out zfs debug buffer before exiting
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/spa.c
          +++ new/usr/src/uts/common/fs/zfs/spa.c
↓ open down ↓ 4438 lines elided ↑ open up ↑
4439 4439                      KM_SLEEP);
4440 4440                  (void) sprintf(oldvd->vdev_path, "%s/%s",
4441 4441                      newvd->vdev_path, "old");
4442 4442                  if (oldvd->vdev_devid != NULL) {
4443 4443                          spa_strfree(oldvd->vdev_devid);
4444 4444                          oldvd->vdev_devid = NULL;
4445 4445                  }
4446 4446          }
4447 4447  
4448 4448          /* mark the device being resilvered */
4449      -        newvd->vdev_resilvering = B_TRUE;
     4449 +        newvd->vdev_resilver_txg = txg;
4450 4450  
4451 4451          /*
4452 4452           * If the parent is not a mirror, or if we're replacing, insert the new
4453 4453           * mirror/replacing/spare vdev above oldvd.
4454 4454           */
4455 4455          if (pvd->vdev_ops != pvops)
4456 4456                  pvd = vdev_add_parent(oldvd, pvops);
4457 4457  
4458 4458          ASSERT(pvd->vdev_top->vdev_parent == rvd);
4459 4459          ASSERT(pvd->vdev_ops == pvops);
↓ open down ↓ 836 lines elided ↑ open up ↑
5296 5296  spa_vdev_resilver_done_hunt(vdev_t *vd)
5297 5297  {
5298 5298          vdev_t *newvd, *oldvd;
5299 5299  
5300 5300          for (int c = 0; c < vd->vdev_children; c++) {
5301 5301                  oldvd = spa_vdev_resilver_done_hunt(vd->vdev_child[c]);
5302 5302                  if (oldvd != NULL)
5303 5303                          return (oldvd);
5304 5304          }
5305 5305  
5306      -        if (vd->vdev_resilvering && vdev_dtl_empty(vd, DTL_MISSING) &&
5307      -            vdev_dtl_empty(vd, DTL_OUTAGE)) {
5308      -                ASSERT(vd->vdev_ops->vdev_op_leaf);
5309      -                vd->vdev_resilvering = B_FALSE;
5310      -                vdev_config_dirty(vd->vdev_top);
5311      -        }
5312      -
5313 5306          /*
5314 5307           * Check for a completed replacement.  We always consider the first
5315 5308           * vdev in the list to be the oldest vdev, and the last one to be
5316 5309           * the newest (see spa_vdev_attach() for how that works).  In
5317 5310           * the case where the newest vdev is faulted, we will not automatically
5318 5311           * remove it after a resilver completes.  This is OK as it will require
5319 5312           * user intervention to determine which disk the admin wishes to keep.
5320 5313           */
5321 5314          if (vd->vdev_ops == &vdev_replacing_ops) {
5322 5315                  ASSERT(vd->vdev_children > 1);
↓ open down ↓ 69 lines elided ↑ open up ↑
5392 5385                  /*
5393 5386                   * If we have just finished replacing a hot spared device, then
5394 5387                   * we need to detach the parent's first child (the original hot
5395 5388                   * spare) as well.
5396 5389                   */
5397 5390                  if (ppvd->vdev_ops == &vdev_spare_ops && pvd->vdev_id == 0 &&
5398 5391                      ppvd->vdev_children == 2) {
5399 5392                          ASSERT(pvd->vdev_ops == &vdev_replacing_ops);
5400 5393                          sguid = ppvd->vdev_child[1]->vdev_guid;
5401 5394                  }
     5395 +                ASSERT(vd->vdev_resilver_txg == 0 || !vdev_dtl_required(vd));
     5396 +
5402 5397                  spa_config_exit(spa, SCL_ALL, FTAG);
5403 5398                  if (spa_vdev_detach(spa, guid, pguid, B_TRUE) != 0)
5404 5399                          return;
5405 5400                  if (sguid && spa_vdev_detach(spa, sguid, ppguid, B_TRUE) != 0)
5406 5401                          return;
5407 5402                  spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
5408 5403          }
5409 5404  
5410 5405          spa_config_exit(spa, SCL_ALL, FTAG);
5411 5406  }
↓ open down ↓ 1094 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX