Bug 196099 - BTRFS critical corrupt leaf slot offset bad
Summary: BTRFS critical corrupt leaf slot offset bad
Status: RESOLVED OBSOLETE
Alias: None
Product: File System
Classification: Unclassified
Component: btrfs (show other bugs)
Hardware: Intel Linux
: P1 high
Assignee: Josef Bacik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-16 20:19 UTC by Pieter Smit
Modified: 2022-10-06 17:50 UTC (History)
3 users (show)

See Also:
Kernel Version: 4.4.0
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Output of failed recover with btrfs 4.4.0 (171.05 KB, text/plain)
2017-06-16 21:09 UTC, Pieter Smit
Details
Output of failed recover with btrfs 4.9.1 (170.95 KB, text/plain)
2017-06-16 21:16 UTC, Pieter Smit
Details
sudo btrfsck --repair -y -v /dev/sda2 (stdio) (88 bytes, text/plain)
2017-06-16 21:52 UTC, Pieter Smit
Details
sudo btrfsck --repair -y -v /dev/sda2 (stderr) (2.64 KB, text/plain)
2017-06-16 21:55 UTC, Pieter Smit
Details

Description Pieter Smit 2017-06-16 20:19:17 UTC
Laptop with 2 ssd in BTRFS Raid0 - forced shutdown, will not boot any-more.

Booted from usb 16.04 Ubuntu to try and recover, also tried upgrading the btrfs-tools to 4.9.1.

# uname -a
Linux ubuntu 4.4.0-31-generic #50-Ubuntu SMP

# mount  /dev/sdb2 /mnt 
mount: wrong fs type, bad option, bad superblock on /dev/sdb2,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

# dmesg | tail
[34306.320408] BTRFS critical (device sdb2): corrupt leaf, slot offset bad: block=558842675200,root=1, slot=26
[34306.320423] BTRFS: Failed to read block groups: -5
[34306.369903] BTRFS: open_ctree failed
[34311.682999] BTRFS info (device sdb2): enabling auto recovery
[34311.683012] BTRFS info (device sdb2): disk space caching is enabled
[34311.683018] BTRFS: has skinny extents
[34311.717788] BTRFS critical (device sdb2): corrupt leaf, slot offset bad: block=558842675200,root=1, slot=26
[34311.718009] BTRFS critical (device sdb2): corrupt leaf, slot offset bad: block=558842675200,root=1, slot=26
[34311.718028] BTRFS: Failed to read block groups: -5
[34311.757816] BTRFS: open_ctree failed


# btrfs --version
btrfs-progs v4.9.1


# btrfs check --repair /dev/sda2
enabling repair mode
incorrect offsets 14881 539169
repair mode will force to clear out log tree, are you sure? [y/N]: y
Unable to find block group for 0
extent-tree.c:289: find_search_start: Warning: assertion `1` failed, value 1
btrfs(+0x47be6)[0x55b95a639be6]
btrfs(btrfs_reserve_extent+0x5b7)[0x55b95a63de00]
btrfs(btrfs_alloc_free_block+0x63)[0x55b95a63e1be]
btrfs(__btrfs_cow_block+0xfe)[0x55b95a631dee]
btrfs(btrfs_cow_block+0xc4)[0x55b95a6323a4]
btrfs(+0x4462e)[0x55b95a63662e]
btrfs(btrfs_commit_transaction+0xb2)[0x55b95a637e7a]
btrfs(cmd_check+0x65b)[0x55b95a62240d]
btrfs(main+0x139)[0x55b95a60983e]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7ffa4a2a8830]
btrfs(_start+0x2a)[0x55b95a60987a]
Unable to find block group for 0
extent-tree.c:289: find_search_start: Warning: assertion `1` failed, value 1
btrfs(+0x47be6)[0x55b95a639be6]
btrfs(btrfs_reserve_extent+0x5b7)[0x55b95a63de00]
btrfs(btrfs_alloc_free_block+0x63)[0x55b95a63e1be]
btrfs(__btrfs_cow_block+0xfe)[0x55b95a631dee]
btrfs(btrfs_cow_block+0xc4)[0x55b95a6323a4]
btrfs(+0x4462e)[0x55b95a63662e]
btrfs(btrfs_commit_transaction+0xb2)[0x55b95a637e7a]
btrfs(cmd_check+0x65b)[0x55b95a62240d]
btrfs(main+0x139)[0x55b95a60983e]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7ffa4a2a8830]
btrfs(_start+0x2a)[0x55b95a60987a]
Unable to find block group for 0
extent-tree.c:289: find_search_start: Warning: assertion `1` failed, value 1
btrfs(+0x47be6)[0x55b95a639be6]
btrfs(btrfs_reserve_extent+0x5b7)[0x55b95a63de00]
btrfs(btrfs_alloc_free_block+0x63)[0x55b95a63e1be]
btrfs(__btrfs_cow_block+0xfe)[0x55b95a631dee]
btrfs(btrfs_cow_block+0xc4)[0x55b95a6323a4]
btrfs(+0x4462e)[0x55b95a63662e]
btrfs(btrfs_commit_transaction+0xb2)[0x55b95a637e7a]
btrfs(cmd_check+0x65b)[0x55b95a62240d]
btrfs(main+0x139)[0x55b95a60983e]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7ffa4a2a8830]
btrfs(_start+0x2a)[0x55b95a60987a]
extent-tree.c:2703: btrfs_reserve_extent: BUG_ON `ret` triggered, value -28
btrfs(+0x47be6)[0x55b95a639be6]
btrfs(+0x47c56)[0x55b95a639c56]
btrfs(+0x47c69)[0x55b95a639c69]
btrfs(btrfs_reserve_extent+0x76a)[0x55b95a63dfb3]
btrfs(btrfs_alloc_free_block+0x63)[0x55b95a63e1be]
btrfs(__btrfs_cow_block+0xfe)[0x55b95a631dee]
btrfs(btrfs_cow_block+0xc4)[0x55b95a6323a4]
btrfs(+0x4462e)[0x55b95a63662e]
btrfs(btrfs_commit_transaction+0xb2)[0x55b95a637e7a]
btrfs(cmd_check+0x65b)[0x55b95a62240d]
btrfs(main+0x139)[0x55b95a60983e]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7ffa4a2a8830]
btrfs(_start+0x2a)[0x55b95a60987a]
Aborted (core dumped)
root@ubuntu:/home/ubuntu/Downloads# 



# btrfs check --readonly /dev/sdb2
incorrect offsets 14881 539169
Checking filesystem on /dev/sdb2
UUID: be6d3734-fb49-42d0-973c-547949d1b013
checking extents
incorrect offsets 14881 539169
bad block 558842675200
ERROR: errors found in extent allocation tree or chunk allocation
checking free space cache
checking fs roots
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
incorrect offsets 7795 532083
	unresolved ref dir 15472 index 0 namelen 104 name ECRYPTFS_FNEK_ENCRYPTED&FXZvkd1KmbFm2-TLjTCVJL3ZxYtD-zomwbXYUucAHBkMRRCJlE9vuOS36gm9wpi7LxUvI9UT8B7H6Js- filetype 1 errors 6, no dir index, no inode ref
	unresolved ref dir 15472 index 152801 namelen 104 name ECRYPTFS_FNEK_ENCRYPTED.FXZvkd1KmbFm2-TLjTCVJL3ZxYtD-zomwbXYUucAHBkMRRCJlE9vuOS36gm9wpi7LxUvI9UT8B7H6Js- filetype 1 errors 1, no dir item
root 258 inode 772374 errors 100, file extent discount
Found file extent holes:
	start: 0, len: 24576
found 105267564544 bytes used err is 1
total csum bytes: 0
total tree bytes: 46825472
total fs tree bytes: 0
total extent tree bytes: 46710784
btree space waste bytes: 16700977
file data blocks allocated: 59506688
 referenced 59506688
root@ubuntu:~#
Comment 1 Pieter Smit 2017-06-16 21:09:37 UTC
Created attachment 257031 [details]
Output of failed recover with btrfs 4.4.0

sudo btrfs rescue chunk-recover -y -v /dev/sda2
Comment 2 Pieter Smit 2017-06-16 21:16:58 UTC
Created attachment 257033 [details]
Output of failed recover with btrfs 4.9.1

$ sudo btrfs rescue chunk-recover -y -v /dev/sda2 > btrfs4.9.1_rescue_chunk-recover-y-v.txt
Comment 3 Pieter Smit 2017-06-16 21:52:49 UTC
Created attachment 257035 [details]
sudo btrfsck --repair -y -v /dev/sda2  (stdio)

sudo btrfsck --repair -y -v /dev/sda2      2>btrfs4.9.1_repair.error.out.txt 1>btrfs4.9.1_repair.stdio.out.txt
      * Aborted (core dumped)
Comment 4 Pieter Smit 2017-06-16 21:55:01 UTC
Created attachment 257037 [details]
sudo btrfsck --repair -y -v /dev/sda2 (stderr)

sudo btrfsck --repair -y -v /dev/sda2      2>btrfs4.9.1_repair.error.out.txt 1>btrfs4.9.1_repair.stdio.out.txt
      * Aborted (core dumped)
Comment 5 Pieter Smit 2017-06-16 22:08:15 UTC
Feel free to close, I am proceeding to format the drives now.

Note You need to log in before you can comment on or make changes to this bug.