3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first
     argument is zero

Reviewed by Matt Ahrens <matthew.ahrens@delphix.com>
Reviewed by George Wilson <george.wilson@delphix.com>
Approved by Eric Schrock <eric.schrock@delphix.com>

References:
  illumos/illumos-gate@fb09f5aad4
  https://illumos.org/issues/3006

Requires:
  zfsonlinux/spl@1c6d149feb

Ported-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1509
This commit is contained in:
Madhav Suresh
2013-05-10 14:17:03 -07:00
committed by Brian Behlendorf
parent 9eaf0832ad
commit c99c90015e
32 changed files with 198 additions and 186 deletions
+7 -7
View File
@@ -598,9 +598,9 @@ vdev_free(vdev_t *vd)
metaslab_group_destroy(vd->vdev_mg);
}
ASSERT3U(vd->vdev_stat.vs_space, ==, 0);
ASSERT3U(vd->vdev_stat.vs_dspace, ==, 0);
ASSERT3U(vd->vdev_stat.vs_alloc, ==, 0);
ASSERT0(vd->vdev_stat.vs_space);
ASSERT0(vd->vdev_stat.vs_dspace);
ASSERT0(vd->vdev_stat.vs_alloc);
/*
* Remove this vdev from its parent's child list.
@@ -1825,7 +1825,7 @@ vdev_dtl_sync(vdev_t *vd, uint64_t txg)
if (vd->vdev_detached) {
if (smo->smo_object != 0) {
VERIFY(0 == dmu_object_free(mos, smo->smo_object, tx));
VERIFY0(dmu_object_free(mos, smo->smo_object, tx));
smo->smo_object = 0;
}
dmu_tx_commit(tx);
@@ -2029,7 +2029,7 @@ vdev_remove(vdev_t *vd, uint64_t txg)
tx = dmu_tx_create_assigned(spa_get_dsl(spa), txg);
if (vd->vdev_dtl_smo.smo_object) {
ASSERT3U(vd->vdev_dtl_smo.smo_alloc, ==, 0);
ASSERT0(vd->vdev_dtl_smo.smo_alloc);
(void) dmu_object_free(mos, vd->vdev_dtl_smo.smo_object, tx);
vd->vdev_dtl_smo.smo_object = 0;
}
@@ -2041,7 +2041,7 @@ vdev_remove(vdev_t *vd, uint64_t txg)
if (msp == NULL || msp->ms_smo.smo_object == 0)
continue;
ASSERT3U(msp->ms_smo.smo_alloc, ==, 0);
ASSERT0(msp->ms_smo.smo_alloc);
(void) dmu_object_free(mos, msp->ms_smo.smo_object, tx);
msp->ms_smo.smo_object = 0;
}
@@ -2319,7 +2319,7 @@ top:
(void) spa_vdev_state_exit(spa, vd, 0);
goto top;
}
ASSERT3U(tvd->vdev_stat.vs_alloc, ==, 0);
ASSERT0(tvd->vdev_stat.vs_alloc);
}
/*