NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
benstone
Mar 11, 2021Star
There seem an error in btrfs scrub code when checksum error found
I run gentoo distribution on my RN626x, so I try to porting netgear's btrfs patched to 4.19. In my testing of mdcsrepaird/mdcsrepair, I found it can not fix the checksum error. The program output "designated checksum not match", and the params pass to mdcsrepair is obvious wrong: the offset should be -32, and the size shoud be +32. So I check the source code fs/btrfs/scrub.c and have 2 founding:
- in function scrub_checksum_data, there is no checksum prefix, so the offset pass to __BTRFS_CSLINK should be 0;
- in function scrub_checksum_tree_block, there is realy a checksum prefix, so the offset pass to __BTRFS_CSLINK should be BTRFS_CSUM_SIZE.
The attached patch fix the 2 problems.(I can't attach then patch file, so I made a picture)
I also checked old version, from 4.4.178 to latest 4.4.190, this issue exist in all version.
Please double check and fix it.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!