From f3b08dfd7f32ccb466e0a55a446948d6c07e497a Mon Sep 17 00:00:00 2001 From: George Amanakis Date: Thu, 3 Feb 2022 23:28:19 +0100 Subject: 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 Signed-off-by: George Amanakis Closes #12720 Closes #13014 --- cmd/zstream/zstream_dump.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cmd/zstream') diff --git a/cmd/zstream/zstream_dump.c b/cmd/zstream/zstream_dump.c index 45cf7b97a..af69a1494 100644 --- a/cmd/zstream/zstream_dump.c +++ b/cmd/zstream/zstream_dump.c @@ -461,6 +461,14 @@ zstream_do_dump(int argc, char *argv[]) BSWAP_64(drro->drr_maxblkid); } + if (drro->drr_bonuslen > drro->drr_raw_bonuslen) { + (void) fprintf(stderr, + "Warning: Object %llu has bonuslen = " + "%u > raw_bonuslen = %u\n\n", + (u_longlong_t)drro->drr_object, + drro->drr_bonuslen, drro->drr_raw_bonuslen); + } + payload_size = DRR_OBJECT_PAYLOAD_SIZE(drro); if (verbose) { -- cgit v1.2.3