HomeFreeBSD

ztest: scrub ddt repair

Description

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

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Jan 17 2019, 11:25 PM
GitHub <noreply@github.com>Committed on Jan 17 2019, 11:25 PM
Parents
rG419ba5914552: Update vdev_is_spacemap_addressable() for new spacemap encoding
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG52b684236d35: ztest: scrub ddt repair (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Jan 17 2019, 11:25 PM