summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2021-04-27 18:33:37 +0300
committerBrian Behlendorf <behlendorf1@llnl.gov>2021-05-19 20:00:08 -0700
commitd7bd243508f98899a2798f4cd34d5726c5e446f7 (patch)
treead74f3f23a4bf384d051e508d5ea27a754ba4c0b
parent19c804c3b5cad6b75ba12cbd2515bc48e2d5a2b0 (diff)
zdb: ASSERT issues when DEBUG is not defined
If zdb is not built with DEBUG mode, the ASSERT macros will be eliminated. This will leave vim defined, but not used (gcc warning) and checkpoint spacemap validation loop will do nothing. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Toomas Soome <tsoome@me.com> Closes #11932
-rw-r--r--cmd/zdb/zdb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index 24243da2e..5158c23b0 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -5840,7 +5840,8 @@ zdb_leak_init_prepare_indirect_vdevs(spa_t *spa, zdb_cb_t *zcb)
*/
VERIFY0(vdev_metaslab_init(vd, 0));
- vdev_indirect_mapping_t *vim = vd->vdev_indirect_mapping;
+ vdev_indirect_mapping_t *vim __maybe_unused =
+ vd->vdev_indirect_mapping;
uint64_t vim_idx = 0;
for (uint64_t m = 0; m < vd->vdev_ms_count; m++) {
@@ -6933,7 +6934,7 @@ verify_checkpoint_vdev_spacemaps(spa_t *checkpoint, spa_t *current)
for (uint64_t c = ckpoint_rvd->vdev_children;
c < current_rvd->vdev_children; c++) {
vdev_t *current_vd = current_rvd->vdev_child[c];
- ASSERT3P(current_vd->vdev_checkpoint_sm, ==, NULL);
+ VERIFY3P(current_vd->vdev_checkpoint_sm, ==, NULL);
}
}