HomeFreeBSD

Fix zdb -c traverse stop on damaged objset root

Description

Fix zdb -c traverse stop on damaged objset root

If a corruption happens to be on a root block of an objset, zdb -c will
not correctly report the error, and it will not traverse the datasets
that come after. This is because traverse_visitbp, which does the
callback and reset error for TRAVERSE_HARD, is skipped when traversing
zil is failed in traverse_impl.

Here's example of what 'zdb -eLcc' command looks like on a pool with
damaged objset root:

before patch:

Traversing all blocks to verify checksums ...

Error counts:

errno count
block traversal size 379392 != alloc 33987072 (unreachable 33607680)

bp count: 172
ganged count: 0
bp logical: 1678336 avg: 9757
bp physical: 130560 avg: 759 compression: 12.85
bp allocated: 379392 avg: 2205 compression: 4.42
bp deduped: 0 ref>1: 0 deduplication: 1.00
SPA allocated: 33987072 used: 0.80%

additional, non-pointer bps of type 0: 71
Dittoed blocks on same vdev: 101

after patch:

Traversing all blocks to verify checksums ...

zdb_blkptr_cb: Got error 52 reading <54, 0, -1, 0> -- skipping

Error counts:

errno count

	   52  1

block traversal size 33963520 != alloc 33987072 (unreachable 23552)

bp count: 447
ganged count: 0
bp logical: 36093440 avg: 80745
bp physical: 33699840 avg: 75391 compression: 1.07
bp allocated: 33963520 avg: 75981 compression: 1.06
bp deduped: 0 ref>1: 0 deduplication: 1.00
SPA allocated: 33987072 used: 0.80%

additional, non-pointer bps of type 0: 76
Dittoed blocks on same vdev: 115

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: Chunwei Chen <david.chen@nutanix.com>
Closes #7099

Details

Provenance
Chunwei Chen <david.chen@nutanix.com>Authored on Jan 30 2018, 9:39 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Feb 9 2018, 6:05 PM
Parents
rG35e0202fd729: OpenZFS 8965 - zfs_acl_ls_001_pos fails due to no longer supported grep regex
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGd3190c5f2914: Fix zdb -c traverse stop on damaged objset root (authored by Chunwei Chen <david.chen@nutanix.com>).Feb 9 2018, 6:05 PM