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

*** 590,602 **** if (vd->vdev_mg != NULL) { vdev_metaslab_fini(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); /* * Remove this vdev from its parent's child list. */ vdev_remove_child(vd->vdev_parent, vd); --- 590,602 ---- if (vd->vdev_mg != NULL) { vdev_metaslab_fini(vd); metaslab_group_destroy(vd->vdev_mg); } ! 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. */ vdev_remove_child(vd->vdev_parent, vd);
*** 1803,1813 **** tx = dmu_tx_create_assigned(spa->spa_dsl_pool, txg); if (vd->vdev_detached) { if (smo->smo_object != 0) { int err = dmu_object_free(mos, smo->smo_object, tx); ! ASSERT3U(err, ==, 0); smo->smo_object = 0; } dmu_tx_commit(tx); return; } --- 1803,1813 ---- tx = dmu_tx_create_assigned(spa->spa_dsl_pool, txg); if (vd->vdev_detached) { if (smo->smo_object != 0) { int err = dmu_object_free(mos, smo->smo_object, tx); ! ASSERT0(err); smo->smo_object = 0; } dmu_tx_commit(tx); return; }
*** 2003,2013 **** dmu_tx_t *tx; 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); (void) dmu_object_free(mos, vd->vdev_dtl_smo.smo_object, tx); vd->vdev_dtl_smo.smo_object = 0; } if (vd->vdev_ms != NULL) { --- 2003,2013 ---- dmu_tx_t *tx; tx = dmu_tx_create_assigned(spa_get_dsl(spa), txg); if (vd->vdev_dtl_smo.smo_object) { ! 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; } if (vd->vdev_ms != NULL) {
*** 2015,2025 **** metaslab_t *msp = vd->vdev_ms[m]; if (msp == NULL || msp->ms_smo.smo_object == 0) continue; ! ASSERT3U(msp->ms_smo.smo_alloc, ==, 0); (void) dmu_object_free(mos, msp->ms_smo.smo_object, tx); msp->ms_smo.smo_object = 0; } } --- 2015,2025 ---- metaslab_t *msp = vd->vdev_ms[m]; if (msp == NULL || msp->ms_smo.smo_object == 0) continue; ! ASSERT0(msp->ms_smo.smo_alloc); (void) dmu_object_free(mos, msp->ms_smo.smo_object, tx); msp->ms_smo.smo_object = 0; } }
*** 2293,2303 **** return (spa_vdev_state_exit(spa, vd, error)); (void) spa_vdev_state_exit(spa, vd, 0); goto top; } ! ASSERT3U(tvd->vdev_stat.vs_alloc, ==, 0); } /* * Offline this device and reopen its top-level vdev. * If the top-level vdev is a log device then just offline --- 2293,2303 ---- return (spa_vdev_state_exit(spa, vd, error)); (void) spa_vdev_state_exit(spa, vd, 0); goto top; } ! ASSERT0(tvd->vdev_stat.vs_alloc); } /* * Offline this device and reopen its top-level vdev. * If the top-level vdev is a log device then just offline