Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
There seem an error in btrfs scrub code when checksum error found
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-03-11
12:49 AM
2021-03-11
12:49 AM
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.
Model: ReadyNAS-OS6|
Message 1 of 1