Print this page
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero
        
*** 840,850 ****
                              (u_longlong_t)ds->ds_object);
                  }
          } else if (zap_lookup_int_key(dp->dp_meta_objset,
              scn->scn_phys.scn_queue_obj, ds->ds_object, &mintxg) == 0) {
                  ASSERT3U(ds->ds_phys->ds_num_children, <=, 1);
!                 VERIFY3U(0, ==, zap_remove_int(dp->dp_meta_objset,
                      scn->scn_phys.scn_queue_obj, ds->ds_object, tx));
                  if (dsl_dataset_is_snapshot(ds)) {
                          /*
                           * We keep the same mintxg; it could be >
                           * ds_creation_txg if the previous snapshot was
--- 840,850 ----
                              (u_longlong_t)ds->ds_object);
                  }
          } else if (zap_lookup_int_key(dp->dp_meta_objset,
              scn->scn_phys.scn_queue_obj, ds->ds_object, &mintxg) == 0) {
                  ASSERT3U(ds->ds_phys->ds_num_children, <=, 1);
!                 VERIFY0(zap_remove_int(dp->dp_meta_objset,
                      scn->scn_phys.scn_queue_obj, ds->ds_object, tx));
                  if (dsl_dataset_is_snapshot(ds)) {
                          /*
                           * We keep the same mintxg; it could be >
                           * ds_creation_txg if the previous snapshot was
*** 892,902 ****
                      "reset zb_objset to %llu",
                      (u_longlong_t)ds->ds_object,
                      (u_longlong_t)ds->ds_phys->ds_prev_snap_obj);
          } else if (zap_lookup_int_key(dp->dp_meta_objset,
              scn->scn_phys.scn_queue_obj, ds->ds_object, &mintxg) == 0) {
!                 VERIFY3U(0, ==, zap_remove_int(dp->dp_meta_objset,
                      scn->scn_phys.scn_queue_obj, ds->ds_object, tx));
                  VERIFY(zap_add_int_key(dp->dp_meta_objset,
                      scn->scn_phys.scn_queue_obj,
                      ds->ds_phys->ds_prev_snap_obj, mintxg, tx) == 0);
                  zfs_dbgmsg("snapshotting ds %llu; in queue; "
--- 892,902 ----
                      "reset zb_objset to %llu",
                      (u_longlong_t)ds->ds_object,
                      (u_longlong_t)ds->ds_phys->ds_prev_snap_obj);
          } else if (zap_lookup_int_key(dp->dp_meta_objset,
              scn->scn_phys.scn_queue_obj, ds->ds_object, &mintxg) == 0) {
!                 VERIFY0(zap_remove_int(dp->dp_meta_objset,
                      scn->scn_phys.scn_queue_obj, ds->ds_object, tx));
                  VERIFY(zap_add_int_key(dp->dp_meta_objset,
                      scn->scn_phys.scn_queue_obj,
                      ds->ds_phys->ds_prev_snap_obj, mintxg, tx) == 0);
                  zfs_dbgmsg("snapshotting ds %llu; in queue; "
*** 935,945 ****
              ds1->ds_object, &mintxg) == 0) {
                  int err;
  
                  ASSERT3U(mintxg, ==, ds1->ds_phys->ds_prev_snap_txg);
                  ASSERT3U(mintxg, ==, ds2->ds_phys->ds_prev_snap_txg);
!                 VERIFY3U(0, ==, zap_remove_int(dp->dp_meta_objset,
                      scn->scn_phys.scn_queue_obj, ds1->ds_object, tx));
                  err = zap_add_int_key(dp->dp_meta_objset,
                      scn->scn_phys.scn_queue_obj, ds2->ds_object, mintxg, tx);
                  VERIFY(err == 0 || err == EEXIST);
                  if (err == EEXIST) {
--- 935,945 ----
              ds1->ds_object, &mintxg) == 0) {
                  int err;
  
                  ASSERT3U(mintxg, ==, ds1->ds_phys->ds_prev_snap_txg);
                  ASSERT3U(mintxg, ==, ds2->ds_phys->ds_prev_snap_txg);
!                 VERIFY0(zap_remove_int(dp->dp_meta_objset,
                      scn->scn_phys.scn_queue_obj, ds1->ds_object, tx));
                  err = zap_add_int_key(dp->dp_meta_objset,
                      scn->scn_phys.scn_queue_obj, ds2->ds_object, mintxg, tx);
                  VERIFY(err == 0 || err == EEXIST);
                  if (err == EEXIST) {
*** 954,964 ****
                      (u_longlong_t)ds2->ds_object);
          } else if (zap_lookup_int_key(dp->dp_meta_objset,
              scn->scn_phys.scn_queue_obj, ds2->ds_object, &mintxg) == 0) {
                  ASSERT3U(mintxg, ==, ds1->ds_phys->ds_prev_snap_txg);
                  ASSERT3U(mintxg, ==, ds2->ds_phys->ds_prev_snap_txg);
!                 VERIFY3U(0, ==, zap_remove_int(dp->dp_meta_objset,
                      scn->scn_phys.scn_queue_obj, ds2->ds_object, tx));
                  VERIFY(0 == zap_add_int_key(dp->dp_meta_objset,
                      scn->scn_phys.scn_queue_obj, ds1->ds_object, mintxg, tx));
                  zfs_dbgmsg("clone_swap ds %llu; in queue; "
                      "replacing with %llu",
--- 954,964 ----
                      (u_longlong_t)ds2->ds_object);
          } else if (zap_lookup_int_key(dp->dp_meta_objset,
              scn->scn_phys.scn_queue_obj, ds2->ds_object, &mintxg) == 0) {
                  ASSERT3U(mintxg, ==, ds1->ds_phys->ds_prev_snap_txg);
                  ASSERT3U(mintxg, ==, ds2->ds_phys->ds_prev_snap_txg);
!                 VERIFY0(zap_remove_int(dp->dp_meta_objset,
                      scn->scn_phys.scn_queue_obj, ds2->ds_object, tx));
                  VERIFY(0 == zap_add_int_key(dp->dp_meta_objset,
                      scn->scn_phys.scn_queue_obj, ds1->ds_object, mintxg, tx));
                  zfs_dbgmsg("clone_swap ds %llu; in queue; "
                      "replacing with %llu",
*** 1012,1022 ****
  {
          dsl_pool_t *dp = scn->scn_dp;
          dsl_dataset_t *ds;
          objset_t *os;
  
!         VERIFY3U(0, ==, dsl_dataset_hold_obj(dp, dsobj, FTAG, &ds));
  
          if (dmu_objset_from_ds(ds, &os))
                  goto out;
  
          /*
--- 1012,1022 ----
  {
          dsl_pool_t *dp = scn->scn_dp;
          dsl_dataset_t *ds;
          objset_t *os;
  
!         VERIFY0(dsl_dataset_hold_obj(dp, dsobj, FTAG, &ds));
  
          if (dmu_objset_from_ds(ds, &os))
                  goto out;
  
          /*
*** 1306,1320 ****
              zap_cursor_retrieve(&zc, &za) == 0) {
                  dsl_dataset_t *ds;
                  uint64_t dsobj;
  
                  dsobj = strtonum(za.za_name, NULL);
!                 VERIFY3U(0, ==, zap_remove_int(dp->dp_meta_objset,
                      scn->scn_phys.scn_queue_obj, dsobj, tx));
  
                  /* Set up min/max txg */
!                 VERIFY3U(0, ==, dsl_dataset_hold_obj(dp, dsobj, FTAG, &ds));
                  if (za.za_first_integer != 0) {
                          scn->scn_phys.scn_cur_min_txg =
                              MAX(scn->scn_phys.scn_min_txg,
                              za.za_first_integer);
                  } else {
--- 1306,1320 ----
              zap_cursor_retrieve(&zc, &za) == 0) {
                  dsl_dataset_t *ds;
                  uint64_t dsobj;
  
                  dsobj = strtonum(za.za_name, NULL);
!                 VERIFY0(zap_remove_int(dp->dp_meta_objset,
                      scn->scn_phys.scn_queue_obj, dsobj, tx));
  
                  /* Set up min/max txg */
!                 VERIFY0(dsl_dataset_hold_obj(dp, dsobj, FTAG, &ds));
                  if (za.za_first_integer != 0) {
                          scn->scn_phys.scn_cur_min_txg =
                              MAX(scn->scn_phys.scn_min_txg,
                              za.za_first_integer);
                  } else {
*** 1432,1464 ****
                  scn->scn_is_bptree = B_FALSE;
                  scn->scn_zio_root = zio_root(dp->dp_spa, NULL,
                      NULL, ZIO_FLAG_MUSTSUCCEED);
                  err = bpobj_iterate(&dp->dp_free_bpobj,
                      dsl_scan_free_block_cb, scn, tx);
!                 VERIFY3U(0, ==, zio_wait(scn->scn_zio_root));
  
                  if (err == 0 && spa_feature_is_active(spa,
                      &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) {
                          scn->scn_is_bptree = B_TRUE;
                          scn->scn_zio_root = zio_root(dp->dp_spa, NULL,
                              NULL, ZIO_FLAG_MUSTSUCCEED);
                          err = bptree_iterate(dp->dp_meta_objset,
                              dp->dp_bptree_obj, B_TRUE, dsl_scan_free_block_cb,
                              scn, tx);
!                         VERIFY3U(0, ==, zio_wait(scn->scn_zio_root));
                          if (err != 0)
                                  return;
  
                          /* disable async destroy feature */
                          spa_feature_decr(spa,
                              &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY], tx);
                          ASSERT(!spa_feature_is_active(spa,
                              &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]));
!                         VERIFY3U(0, ==, zap_remove(dp->dp_meta_objset,
                              DMU_POOL_DIRECTORY_OBJECT,
                              DMU_POOL_BPTREE_OBJ, tx));
!                         VERIFY3U(0, ==, bptree_free(dp->dp_meta_objset,
                              dp->dp_bptree_obj, tx));
                          dp->dp_bptree_obj = 0;
                  }
                  if (scn->scn_visited_this_txg) {
                          zfs_dbgmsg("freed %llu blocks in %llums from "
--- 1432,1464 ----
                  scn->scn_is_bptree = B_FALSE;
                  scn->scn_zio_root = zio_root(dp->dp_spa, NULL,
                      NULL, ZIO_FLAG_MUSTSUCCEED);
                  err = bpobj_iterate(&dp->dp_free_bpobj,
                      dsl_scan_free_block_cb, scn, tx);
!                 VERIFY0(zio_wait(scn->scn_zio_root));
  
                  if (err == 0 && spa_feature_is_active(spa,
                      &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) {
                          scn->scn_is_bptree = B_TRUE;
                          scn->scn_zio_root = zio_root(dp->dp_spa, NULL,
                              NULL, ZIO_FLAG_MUSTSUCCEED);
                          err = bptree_iterate(dp->dp_meta_objset,
                              dp->dp_bptree_obj, B_TRUE, dsl_scan_free_block_cb,
                              scn, tx);
!                         VERIFY0(zio_wait(scn->scn_zio_root));
                          if (err != 0)
                                  return;
  
                          /* disable async destroy feature */
                          spa_feature_decr(spa,
                              &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY], tx);
                          ASSERT(!spa_feature_is_active(spa,
                              &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]));
!                         VERIFY0(zap_remove(dp->dp_meta_objset,
                              DMU_POOL_DIRECTORY_OBJECT,
                              DMU_POOL_BPTREE_OBJ, tx));
!                         VERIFY0(bptree_free(dp->dp_meta_objset,
                              dp->dp_bptree_obj, tx));
                          dp->dp_bptree_obj = 0;
                  }
                  if (scn->scn_visited_this_txg) {
                          zfs_dbgmsg("freed %llu blocks in %llums from "