HomeFreeBSD

Verify BPs in spa_load_verify_cb() and dsl_scan_visitbp()

Description

Verify BPs in spa_load_verify_cb() and dsl_scan_visitbp()

We want zpool import to be highly robust and never panic, even
when encountering corrupt metadata. This is already handled in the
arc_read() code path, which covers most cases, but spa_load_verify_cb()
relies on zio_read() and is responsible for verifying the block pointer.

During import it is also possible to encounter blocks pointers which
contain ZIO_COMPRESS_INHERIT and ZIO_CHECKSUM_INHERIT values. Relax
the verification function slightly to allow this.

Futhermore, extend dsl_scan_recurse() to verify the block pointer
contents of level zero blocks which are not of type DMU_OT_DNODE or
DMU_OT_OBJSET. This is handled by arc_read() in the other cases.

Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13124
Closes #13360

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on May 20 2022, 5:36 PM
GitHub <noreply@github.com>Committed on May 20 2022, 5:36 PM
Parents
rG03df6bad9450: zdb: Fix handling of nul termination in symlink targets
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG2cd0f98f4aae: Verify BPs in spa_load_verify_cb() and dsl_scan_visitbp() (authored by Brian Behlendorf <behlendorf1@llnl.gov>).May 20 2022, 5:36 PM