]> git.proxmox.com Git - mirror_zfs.git/commit
zdb: rework dedup accounting for log, quota and prune
authorRob Norris <rob.norris@klarasystems.com>
Tue, 18 Jun 2024 04:11:11 +0000 (14:11 +1000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 4 Sep 2024 21:16:42 +0000 (14:16 -0700)
commit4a4f7b019fa57e2a196e95492aecbed1f312be3a
treeb23bab7b773442309c79ecf4652b56ec7727acb2
parentbf8c61f489e07ddcfed246768059b37808b7f6e5
zdb: rework dedup accounting for log, quota and prune

The simplest thing first: add the FDT and log objects to the list of
objects to be considered when checking for leaks.

The rest is based on a conceptual change in all of this patch stack: a
block on disk with a 'D' bit is not necessarily in the DDT at all
(pruned), or in the DDT ZAPs (still on the log).

As such, walking the DDT up front is difficult (for all the reasons that
walking an unflushed log is difficult) and not really useful, since it's
not a reflection of what's on disk anyway.

Instead, we rework things here to be more like the BRT checks. When we
see a dedup'd block, we look it up in the DDT, consume a refcount, and
for the second-or-later instances, count them as duplicates.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Allan Jude <allan@klarasystems.com>
Co-authored-by: Don Brady <don.brady@klarasystems.com>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Sponsored-by: Klara, Inc.
Sponsored-by: iXsystems, Inc.
Closes #16277
module/zfs/ddt.c