× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

There seem an error in btrfs scrub code when checksum error found

benstone
Star

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:

  1. in function scrub_checksum_data, there is no checksum prefix, so the offset pass to __BTRFS_CSLINK should be 0;
  2. 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.

Model: ReadyNAS-OS6|
Message 1 of 1
Top Contributors
Discussion stats
  • 0 replies
  • 748 views
  • 0 kudos
  • 1 in conversation
Announcements