]> git.proxmox.com Git - mirror_zfs.git/commitdiff
zdb: Fix false leak report for BRT objects
authorBi11 <Bi11gates9999@gmail.com>
Tue, 13 Feb 2024 00:58:47 +0000 (08:58 +0800)
committerGitHub <noreply@github.com>
Tue, 13 Feb 2024 00:58:47 +0000 (16:58 -0800)
Fix a misreport in 'zdb -d' where it falsely marked
BRT objects as leaked.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Yuxin Wang <yuxinwang9999@gmail.com>
Closes #15882

cmd/zdb/zdb.c

index afdc5a2c8b54c3ea58fcfb96284b387fb30bd09e..b857e61bd04fad9b9ce746a9ae9012c616f25994 100644 (file)
@@ -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.
         */