kdave / btrfs-progs

Development of userspace BTRFS tools
GNU General Public License v2.0
557 stars 242 forks source link

bug in btrfs-progs #166

Open frank-dspeed opened 5 years ago

frank-dspeed commented 5 years ago

root@frank-MS-7821:~/btrfs-progs-v4.20.2# sudo btrfs check --readonly /dev/sdd Opening filesystem to check... Checking filesystem on /dev/sdd UUID: 7581a66e-e6fd-472c-8a40-1e67c9ba3fbb [1/7] checking root items [2/7] checking extents bad key ordering 73 74 bad block 32129024 ERROR: errors found in extent allocation tree or chunk allocation [3/7] checking free space cache block group 137469362176 has wrong amount of free space, free space cache has 153583616 block group has 152453120 ERROR: free space cache has more free space than block group item, this could leads to serious corruption, please contact btrfs developers failed to load free space cache for block group 137469362176 block group 318931730432 has wrong amount of free space, free space cache has 33980416 block group has 33996800 failed to load free space cache for block group 318931730432 [4/7] checking fs roots check/main.c:1243: leave_shared_node: BUG_ON node->refs <= 1 triggered, value 1 btrfs(+0x5bb44)[0x563cd4c1bb44] btrfs(+0x5bbea)[0x563cd4c1bbea] btrfs(+0x6485b)[0x563cd4c2485b] btrfs(cmd_check+0x2d68)[0x563cd4c2ae9f] btrfs(main+0x8b)[0x563cd4bd36eb] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f83ed050b97] btrfs(_start+0x2a)[0x563cd4bd339a] Abgebrochen

lorddoskias commented 5 years ago

Your machine seems to have faulty ram, because the values that btrfs-progs report have adjacent bits flipped, i.e. : 00000010 00000110 10000000 00000000 = 33980416 00000010 00000110 11000000 00000000 = 33996800

00001001 00100111 10000000 00000000 = 153583616 00001001 00010110 01000000 00000000 = 152453120

01001001 = 73 01001010 = 74

There has been certain amount of hardening happening in btrfs lately to be able to detect those during write and not persist them on-disk.

frank-dspeed commented 5 years ago

@lorddoskias the disk was in a pc with bad ram maybe the ram in this machine got replaced 3 days befor

adam900710 commented 5 years ago

This problem should be fixed in next release.

Would you please try devel branch to see if this solves the problem?

frank-dspeed commented 5 years ago

will re evaluate

frank-dspeed commented 5 years ago

@adam900710 it works a bit better it shows some extra info but errors

./btrfs check --readonly /dev/sde
Opening filesystem to check...
Checking filesystem on /dev/sde
UUID: 7581a66e-e6fd-472c-8a40-1e67c9ba3fbb
[1/7] checking root items
bad key ordering 0 1
bad key ordering 0 1
bad key ordering 0 1
bad key ordering 73 74
bad key ordering 73 74
bad key ordering 73 74
bad key ordering 2 3
bad key ordering 2 3
bad key ordering 2 3
[2/7] checking extents
bad key ordering 73 74
bad block 32129024
ERROR: errors found in extent allocation tree or chunk allocation
[3/7] checking free space cache
block group 137469362176 has wrong amount of free space, free space cache has 153583616 block group has 152453120
ERROR: free space cache has more free space than block group item, this could leads to serious corruption, please contact btrfs developers
failed to load free space cache for block group 137469362176
block group 318931730432 has wrong amount of free space, free space cache has 33980416 block group has 33996800
failed to load free space cache for block group 318931730432
[4/7] checking fs roots
check/main.c:1230: leave_shared_node: BUG_ON `node->refs <= 1` triggered, value 1
./btrfs(+0x5c3e6)[0x55670ac453e6]
./btrfs(+0x5c48c)[0x55670ac4548c]
./btrfs(+0x6547c)[0x55670ac4e47c]
./btrfs(cmd_check+0x2d68)[0x55670ac54b00]
./btrfs(main+0x8b)[0x55670abfc9ab]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7ff373cbeb97]
./btrfs(_start+0x2a)[0x55670abfc65a]
Abgebrochen (Speicherabzug geschrieben)
marcosps commented 4 years ago

@frank-dspeed can you please check with the most recent release to check if the bug was fixed? Thanks!

frank-dspeed commented 4 years ago

@marcosps this was the current master branch by the way ./btrfs --version btrfs-progs v5.6

sudo ./btrfs check --readonly /dev/sdc
Opening filesystem to check...
Checking filesystem on /dev/sdc
UUID: 7581a66e-e6fd-472c-8a40-1e67c9ba3fbb
[1/7] checking root items
bad key ordering 0 1
bad key ordering 0 1
bad key ordering 0 1
bad key ordering 73 74
bad key ordering 73 74
bad key ordering 73 74
bad key ordering 2 3
bad key ordering 2 3
bad key ordering 2 3
[2/7] checking extents
bad key ordering 73 74
bad block 32129024
ERROR: errors found in extent allocation tree or chunk allocation
[3/7] checking free space cache
block group 137469362176 has wrong amount of free space, free space cache has 153583616 block group has 152453120
ERROR: free space cache has more free space than block group item, this could leads to serious corruption, please contact btrfs developers
failed to load free space cache for block group 137469362176
block group 318931730432 has wrong amount of free space, free space cache has 33980416 block group has 33996800
failed to load free space cache for block group 318931730432
[4/7] checking fs roots
check/main.c:1267: leave_shared_node: BUG_ON `node->refs <= 1` triggered, value 1
./btrfs(+0x3611d)[0x56383c15c11d]
./btrfs(+0x3db34)[0x56383c163b34]
./btrfs(+0x472ad)[0x56383c16d2ad]
./btrfs(main+0x98)[0x56383c13be88]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f89a67b00b3]
./btrfs(_start+0x2e)[0x56383c13ba0e]
Abgebrochen