Report dnodes with faulty bonuslen
commitf3b08dfd7f32ccb466e0a55a446948d6c07e497a
authorGeorge Amanakis <gamanakis@gmail.com>
Thu, 3 Feb 2022 22:28:19 +0000 (3 23:28 +0100)
committerGitHub <noreply@github.com>
Thu, 3 Feb 2022 22:28:19 +0000 (3 14:28 -0800)
tree09f81c2ccd5e28b8728e123260c6f372a6c1a974
parent142a5010ab65b8622619bb831c906cbc21b82b41
Report dnodes with faulty bonuslen

In files created/modified before 4254acb there may be a corruption of
xattrs which is not reported during scrub and normal send/receive. It
manifests only as an error when raw sending/receiving. This happens
because currently only the raw receive path checks for discrepancies
between the dnode bonus length and the spill pointer flag.

In case we encounter a dnode whose bonus length is greater than the
predicted one, we should report an error. Modify in this regard
dnode_sync() with an assertion at the end, dump_dnode() to error out,
dsl_scan_recurse() to report errors during a scrub, and zstream to
report a warning when dumping. Also added a test to verify spill blocks
are sent correctly in a raw send.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #12720
Closes #13014
cmd/zstream/zstream_dump.c
module/zfs/dmu_send.c
module/zfs/dnode_sync.c
module/zfs/dsl_scan.c
tests/runfiles/common.run
tests/zfs-tests/tests/functional/rsend/Makefile.am
tests/zfs-tests/tests/functional/rsend/send_raw_spill_block.ksh [new file with mode: 0755]