]> git.proxmox.com Git - mirror_zfs.git/commit
ztest: scrub ddt repair
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 17 Jan 2019 23:25:00 +0000 (15:25 -0800)
committerGitHub <noreply@github.com>
Thu, 17 Jan 2019 23:25:00 +0000 (15:25 -0800)
commit52b684236d35c64bb371bd19ce0c87552e368d77
treefaaa0151b63e4ade0ec119467e2a9f3698a6918a
parent419ba5914552c6185afbe1dd17b3ed4b0d526547
ztest: scrub ddt repair

The ztest_ddt_repair() test is designed inflict damage to the
ddt which can be repairable by a scrub.  Unfortunately, this
repair logic was broken at some point and it went undetected.
This issue is not specific to ztest, but thankfully this extra
redundancy is rarely enabled and even more rarely needed.

The root cause was identified to be the ddt_bp_create()
function called by dsl_scan_ddt_entry() which did not set the
dedup bit of the generated block pointer.

The consequence of this was that the ZIO_DDT_READ_PIPELINE was
never enabled for the block pointer during the scrub, and the
dedup ditto repair logic was never run.  Note that for demand
reads which don't rely on ddt_bp_create() the required pipeline
stages would be enabled and the repair performed.

This was resolved by unconditionally setting the dedup bit in
ddt_bp_create().  This way all codes paths which may need to
perform a repair from a block pointer generated from the dtt
entry will be able too.  The only exception is that the dedup
bit is cleared in ddt_phys_free() which is required to avoid
leaking space.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Tom Caputi <tcaputi@datto.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8270
cmd/ztest/ztest.c
module/zfs/ddt.c