325dba6432
[BUG] When running "btrfs check --check-data-csum" on fs with corrupted data, the error message almost makes no sense: $ btrfs check --check-data-csum /dev/test/test Opening filesystem to check... Checking filesystem on /dev/test/test UUID: c31afe0a-55bc-4e7d-aba0-9dfa9ddf8090 [1/7] checking root items [2/7] checking extents [3/7] checking free space cache [4/7] checking fs roots [5/7] checking csums against data mirror 1 bytenr 13631488 csum 19 expected csum 152 <<< ERROR: errors found in csum tree [6/7] checking root refs [7/7] checking quota groups skipped (not enabled on this FS) found 147456 bytes used, error(s) found total csum bytes: 16 total tree bytes: 131072 total fs tree bytes: 32768 total extent tree bytes: 16384 btree space waste bytes: 124799 file data blocks allocated: 16384 referenced 16384 [CAUSE] We're just outputting the first byte and in decimal, which is completely different from what we did in kernel space, nor what we did for metadata csum mismatch. [FIX] Use btrfs_format_csum() for btrfs-check to output csum. Now the result looks much better: [5/7] checking csums against data mirror 1 bytenr 13631488 csum 0x13fec125 expected csum 0x98757625 Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> |
||
---|---|---|
.. | ||
common.h | ||
main.c | ||
mode-common.c | ||
mode-common.h | ||
mode-lowmem.c | ||
mode-lowmem.h | ||
mode-original.h | ||
qgroup-verify.c | ||
qgroup-verify.h |