Skip to content

Commit d1277e2

Browse files
tsoometonyhutter
authored andcommitted
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 <[email protected]> Signed-off-by: Toomas Soome <[email protected]> Closes #11932
1 parent a59bf29 commit d1277e2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmd/zdb/zdb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5840,7 +5840,8 @@ zdb_leak_init_prepare_indirect_vdevs(spa_t *spa, zdb_cb_t *zcb)
58405840
*/
58415841
VERIFY0(vdev_metaslab_init(vd, 0));
58425842

5843-
vdev_indirect_mapping_t *vim = vd->vdev_indirect_mapping;
5843+
vdev_indirect_mapping_t *vim __maybe_unused =
5844+
vd->vdev_indirect_mapping;
58445845
uint64_t vim_idx = 0;
58455846
for (uint64_t m = 0; m < vd->vdev_ms_count; m++) {
58465847

@@ -6933,7 +6934,7 @@ verify_checkpoint_vdev_spacemaps(spa_t *checkpoint, spa_t *current)
69336934
for (uint64_t c = ckpoint_rvd->vdev_children;
69346935
c < current_rvd->vdev_children; c++) {
69356936
vdev_t *current_vd = current_rvd->vdev_child[c];
6936-
ASSERT3P(current_vd->vdev_checkpoint_sm, ==, NULL);
6937+
VERIFY3P(current_vd->vdev_checkpoint_sm, ==, NULL);
69376938
}
69386939
}
69396940

0 commit comments

Comments
 (0)