Skip to content

Commit

Permalink
zdb: Fix false leak report for BRT objects
Browse files Browse the repository at this point in the history
Fix a misreport in 'zdb -d' where it falsely marked
BRT objects as leaked.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Yuxin Wang <[email protected]>
Closes #15882
  • Loading branch information
Bi11 authored Feb 13, 2024
1 parent 6cc93cc commit a0635ae
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/zdb/zdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -7952,6 +7952,17 @@ dump_mos_leaks(spa_t *spa)
}
}

if (spa->spa_brt != NULL) {
brt_t *brt = spa->spa_brt;
for (uint64_t vdevid = 0; vdevid < brt->brt_nvdevs; vdevid++) {
brt_vdev_t *brtvd = &brt->brt_vdevs[vdevid];
if (brtvd != NULL && brtvd->bv_initiated) {
mos_obj_refd(brtvd->bv_mos_brtvdev);
mos_obj_refd(brtvd->bv_mos_entries);
}
}
}

/*
* Visit all allocated objects and make sure they are referenced.
*/
Expand Down

0 comments on commit a0635ae

Please sign in to comment.