From: Bi11 Date: Tue, 13 Feb 2024 00:58:47 +0000 (+0800) Subject: zdb: Fix false leak report for BRT objects X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=a0635ae731735d2ec383396ba57e79ee608f7a54;p=mirror_zfs.git zdb: Fix false leak report for BRT objects Fix a misreport in 'zdb -d' where it falsely marked BRT objects as leaked. Reviewed-by: Brian Behlendorf Reviewed-by: Alexander Motin Signed-off-by: Yuxin Wang Closes #15882 --- diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index afdc5a2c8..b857e61bd 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -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. */