{ ztest_fault_inject, 1, &zopt_sometimes },
{ ztest_ddt_repair, 1, &zopt_sometimes },
{ ztest_dmu_snapshot_hold, 1, &zopt_sometimes },
- { ztest_reguid, 1, &zopt_sometimes },
+ { ztest_reguid, 1, &zopt_rarely },
{ ztest_spa_rename, 1, &zopt_rarely },
{ ztest_scrub, 1, &zopt_rarely },
{ ztest_spa_upgrade, 1, &zopt_rarely },
ASSERT(leaves >= 1);
+ /*
+ * Grab the name lock as reader. There are some operations
+ * which don't like to have their vdevs changed while
+ * they are in progress (i.e. spa_change_guid). Those
+ * operations will have grabbed the name lock as writer.
+ */
+ (void) rw_enter(&ztest_name_lock, RW_READER);
+
/*
* We need SCL_STATE here because we're going to look at vd0->vdev_tsd.
*/
if (vd0 != NULL && vd0->vdev_top->vdev_islog)
islog = B_TRUE;
- if (vd0 != NULL && maxfaults != 1) {
+ /*
+ * If the top-level vdev needs to be resilvered
+ * then we only allow faults on the device that is
+ * resilvering.
+ */
+ if (vd0 != NULL && maxfaults != 1 &&
+ (!vdev_resilver_needed(vd0->vdev_top, NULL, NULL) ||
+ vd0->vdev_resilvering)) {
/*
* Make vd0 explicitly claim to be unreadable,
* or unwriteable, or reach behind its back
if (sav->sav_count == 0) {
spa_config_exit(spa, SCL_STATE, FTAG);
+ (void) rw_exit(&ztest_name_lock);
goto out;
}
vd0 = sav->sav_vdevs[ztest_random(sav->sav_count)];
}
spa_config_exit(spa, SCL_STATE, FTAG);
+ (void) rw_exit(&ztest_name_lock);
/*
* If we can tolerate two or more faults, or we're dealing
int error;
uint64_t guid;
+ mutex_enter(&spa->spa_vdev_top_lock);
mutex_enter(&spa_namespace_lock);
guid = spa_generate_guid(NULL);
}
mutex_exit(&spa_namespace_lock);
+ mutex_exit(&spa->spa_vdev_top_lock);
return (error);
}
if (pvd->vdev_ops == &vdev_spare_ops)
cvd->vdev_unspare = B_FALSE;
vdev_remove_parent(cvd);
- cvd->vdev_resilvering = B_FALSE;
}
return (oldvd);
}
+ if (vd->vdev_resilvering && vdev_dtl_empty(vd, DTL_MISSING) &&
+ vdev_dtl_empty(vd, DTL_OUTAGE)) {
+ ASSERT(vd->vdev_ops->vdev_op_leaf);
+ vd->vdev_resilvering = B_FALSE;
+ vdev_config_dirty(vd->vdev_top);
+ }
+
/*
* Check for a completed replacement. We always consider the first
* vdev in the list to be the oldest vdev, and the last one to be
static int
vdev_file_io_start(zio_t *zio)
{
- spa_t *spa = zio->io_spa;
vdev_t *vd = zio->io_vd;
vdev_file_t *vf = vd->vdev_tsd;
return (ZIO_PIPELINE_CONTINUE);
}
- spa_taskq_dispatch_ent(spa, ZIO_TYPE_FREE, ZIO_TASKQ_ISSUE,
- vdev_file_io_strategy, zio, 0, &zio->io_tqent);
+ VERIFY3U(taskq_dispatch(system_taskq, vdev_file_io_strategy, zio,
+ TQ_SLEEP), !=, 0);
return (ZIO_PIPELINE_STOP);
}