Bug 120311 - btrfs balance gives segmentation fault
Summary: btrfs balance gives segmentation fault
Status: NEW
Alias: None
Product: File System
Classification: Unclassified
Component: btrfs (show other bugs)
Hardware: All Linux
: P1 blocking
Assignee: Josef Bacik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-15 07:03 UTC by Paul Verreth
Modified: 2023-06-03 11:43 UTC (History)
3 users (show)

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


Attachments
Testcase (25.75 KB, text/plain)
2016-06-16 15:49 UTC, Paul Verreth
Details
Testcase: btrfs rescue (1.21 KB, text/plain)
2016-06-16 20:12 UTC, Paul Verreth
Details

Description Paul Verreth 2016-06-15 07:03:53 UTC
Doingg a btrfs balance with whatever options gives a segmentation fault after some minutes.

First I did a balance for balancing over 2 raid1 drives, and the second time for removing a device from the filesystem.

At this moment I can't boot  from the filesystem, and when booting from a live USB-stick the balance restarts, and is marked active, but there is no progress anymore.


btrfs fi balance start -f -dconvert=single -mconvert=single /mnt
"Segmentation fault"


Jun 10 03:28:39 ubuntu kernel: [ 1788.907427] ------------[ cut here ]------------
Jun 10 03:28:39 ubuntu kernel: [ 1788.907444] kernel BUG at /build/linux-Ay7j_C/linux-4.4.0/fs/btrfs/relocation.c:2683!
Jun 10 03:28:39 ubuntu kernel: [ 1788.907461] invalid opcode: 0000 [#1] SMP 
Jun 10 03:28:39 ubuntu kernel: [ 1788.907473] Modules linked in: snd_hda_codec_realtek snd_hda_codec_hdmi snd_hda_codec_generic intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp snd_hda_intel kvm snd_hda_codec snd_hda_core irqbypass snd_hwdep snd_pcm crct10dif_pclmul snd_seq_midi eeepc_wmi crc32_pclmul snd_seq_midi_event asus_wmi snd_rawmidi aesni_intel sparse_keymap snd_seq aes_x86_64 snd_seq_device lrw snd_timer input_leds gf128mul snd glue_helper serio_raw mei_me soundcore mei ablk_helper cryptd shpchp lpc_ich 8250_fintek mac_hid tpm_infineon parport_pc ppdev lp parport autofs4 squashfs overlay nls_utf8 isofs hid_generic usbhid hid uas usb_storage btrfs xor raid6_pq nls_iso8859_1 dm_mirror dm_region_hash dm_log i915 mxm_wmi i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops e1000e drm ahci ptp libahci pps_core fjes wmi video
Jun 10 03:28:39 ubuntu kernel: [ 1788.907693] CPU: 0 PID: 6564 Comm: btrfs Not tainted 4.4.0-21-generic #37-Ubuntu
Jun 10 03:28:39 ubuntu kernel: [ 1788.907709] Hardware name: ASUS All Series/Z87-PLUS, BIOS 1707 12/13/2013
Jun 10 03:28:39 ubuntu kernel: [ 1788.907725] task: ffff8803cfd22940 ti: ffff8803cfe78000 task.ti: ffff8803cfe78000
Jun 10 03:28:39 ubuntu kernel: [ 1788.907741] RIP: 0010:[<ffffffffc033be85>]  [<ffffffffc033be85>] do_relocation+0x515/0x520 [btrfs]
Jun 10 03:28:39 ubuntu kernel: [ 1788.907778] RSP: 0018:ffff8803cfe7b940  EFLAGS: 00010202
Jun 10 03:28:39 ubuntu kernel: [ 1788.907790] RAX: 0000000000000001 RBX: ffff8803714dc780 RCX: 0000000000000000
Jun 10 03:28:39 ubuntu kernel: [ 1788.907805] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
Jun 10 03:28:39 ubuntu kernel: [ 1788.907821] RBP: ffff8803cfe7b9f8 R08: ffff8803cfe7b8f4 R09: 0000160000000000
Jun 10 03:28:39 ubuntu kernel: [ 1788.907836] R10: 0000000000000002 R11: 0000000000000045 R12: ffff88035e40dc00
Jun 10 03:28:39 ubuntu kernel: [ 1788.907851] R13: ffff88009f01a000 R14: ffff8803823c2780 R15: 0000000000000001
Jun 10 03:28:39 ubuntu kernel: [ 1788.907867] FS:  00007f6fa276e8c0(0000) GS:ffff88042fa00000(0000) knlGS:0000000000000000
Jun 10 03:28:39 ubuntu kernel: [ 1788.907884] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jun 10 03:28:39 ubuntu kernel: [ 1788.907897] CR2: 00007fa24ffbe014 CR3: 00000003cfe13000 CR4: 00000000001406f0
Jun 10 03:28:39 ubuntu kernel: [ 1788.907912] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
Jun 10 03:28:39 ubuntu kernel: [ 1788.907928] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Jun 10 03:28:39 ubuntu kernel: [ 1788.907943] Stack:
Jun 10 03:28:39 ubuntu kernel: [ 1788.907948]  0000000000000000 ffff88009f01c920 ffff8800bd98e000 ffff88035e40dc40
Jun 10 03:28:39 ubuntu kernel: [ 1788.907967]  ffff88009f01c800 ffff8803823c24e0 0000000100000000 ffff880415345780
Jun 10 03:28:39 ubuntu kernel: [ 1788.907986]  ffff8803cfe7b980 ffff8803cfe7b980 ffff88037cbfd500 ffff8803823c2780
Jun 10 03:28:39 ubuntu kernel: [ 1788.908005] Call Trace:
Jun 10 03:28:39 ubuntu kernel: [ 1788.908019]  [<ffffffffc02d8a67>] ? btrfs_block_rsv_refill+0x37/0xb0 [btrfs]
Jun 10 03:28:39 ubuntu kernel: [ 1788.908043]  [<ffffffffc033e50e>] relocate_tree_blocks+0x4ee/0x5f0 [btrfs]
Jun 10 03:28:39 ubuntu kernel: [ 1788.908064]  [<ffffffffc0338c1d>] ? tree_insert+0x4d/0x60 [btrfs]
Jun 10 03:28:39 ubuntu kernel: [ 1788.908084]  [<ffffffffc033c415>] ? add_tree_block+0x155/0x1e0 [btrfs]
Jun 10 03:28:39 ubuntu kernel: [ 1788.908105]  [<ffffffffc033fa7a>] relocate_block_group+0x41a/0x6c0 [btrfs]
Jun 10 03:28:39 ubuntu kernel: [ 1788.908128]  [<ffffffffc0307860>] ? btrfs_wait_ordered_roots+0x1d0/0x200 [btrfs]
Jun 10 03:28:39 ubuntu kernel: [ 1788.908151]  [<ffffffffc033fed3>] btrfs_relocate_block_group+0x1b3/0x290 [btrfs]
Jun 10 03:28:39 ubuntu kernel: [ 1788.908175]  [<ffffffffc0315567>] btrfs_relocate_chunk.isra.38+0x47/0xd0 [btrfs]
Jun 10 03:28:39 ubuntu kernel: [ 1788.908198]  [<ffffffffc03169c9>] __btrfs_balance+0x5b9/0xba0 [btrfs]
Jun 10 03:28:39 ubuntu kernel: [ 1788.908219]  [<ffffffffc0317240>] btrfs_balance+0x290/0x5f0 [btrfs]
Jun 10 03:28:39 ubuntu kernel: [ 1788.908240]  [<ffffffffc0323957>] btrfs_ioctl_balance+0x377/0x390 [btrfs]
Jun 10 03:28:39 ubuntu kernel: [ 1788.908262]  [<ffffffffc03250d0>] btrfs_ioctl+0x550/0x28b0 [btrfs]
Jun 10 03:28:39 ubuntu kernel: [ 1788.908278]  [<ffffffff8120018b>] ? mem_cgroup_try_charge+0x6b/0x1b0
Jun 10 03:28:39 ubuntu kernel: [ 1788.908293]  [<ffffffff8119dfd7>] ? lru_cache_add_active_or_unevictable+0x27/0xa0
Jun 10 03:28:39 ubuntu kernel: [ 1788.908311]  [<ffffffff811bf87a>] ? handle_mm_fault+0xcaa/0x1820
Jun 10 03:28:39 ubuntu kernel: [ 1788.908325]  [<ffffffff812200ff>] do_vfs_ioctl+0x29f/0x490
Jun 10 03:28:39 ubuntu kernel: [ 1788.908338]  [<ffffffff8106b554>] ? __do_page_fault+0x1b4/0x400
Jun 10 03:28:39 ubuntu kernel: [ 1788.908351]  [<ffffffff81220369>] SyS_ioctl+0x79/0x90
Jun 10 03:28:39 ubuntu kernel: [ 1788.908365]  [<ffffffff818244f2>] entry_SYSCALL_64_fastpath+0x16/0x71
Jun 10 03:28:39 ubuntu kernel: [ 1788.908378] Code: fd ff ff 0f 0b 0f b6 43 70 48 8b b5 58 ff ff ff 48 8d 04 c6 48 8b 10 48 89 53 68 48 c7 00 00 00 00 00 0f b6 53 70 e9 db fe ff ff <0f> 0b 0f 0b e8 b2 4e d4 c0 66 90 0f 1f 44 00 00 55 ba b8 05 00 
Jun 10 03:28:39 ubuntu kernel: [ 1788.908465] RIP  [<ffffffffc033be85>] do_relocation+0x515/0x520 [btrfs]
Jun 10 03:28:39 ubuntu kernel: [ 1788.908487]  RSP <ffff8803cfe7b940>
Jun 10 03:28:39 ubuntu kernel: [ 1788.911887] ---[ end trace b0e6c6829fe54927 ]---
Comment 1 Paul Verreth 2016-06-16 15:49:40 UTC
Created attachment 220301 [details]
Testcase

Test with USB-stick, see attachment
Comment 2 Paul Verreth 2016-06-16 20:12:44 UTC
Created attachment 220381 [details]
Testcase: btrfs rescue
Comment 3 happysmash27 2021-05-23 19:03:28 UTC
I also got this bug when I accidentally tried to use raid0 data and raid1 metadata on two IMGs mounted as loop devices: 

 % sudo losetup -f ~/RaidIMG/bellezas_pt1.img
 % sudo losetup -f /mnt/MEGA/RaidIMG/bellezas_pt2.img
 % lsblk
NAME              MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
loop0               7:0    0    29G  1 loop
├─loop0p1         259:0    0     2M  1 part
├─loop0p2         259:1    0   128M  1 part
└─loop0p3         259:2    0  28,9G  1 part
  └─app           253:6    0  28,9G  1 crypt
    ├─vg2-swap    253:7    0     6G  0 lvm
    └─vg2-root    253:8    0  22,9G  0 lvm   /mnt/vg2-root
loop1               7:1    0     1G  0 loop
loop2               7:2    0     1G  0 loop
sda                 8:0    0 931,5G  0 disk
├─sda1              8:1    0     2M  0 part
├─sda2              8:2    0   128M  0 part
└─sda3              8:3    0 931,4G  0 part
  └─root          253:0    0 931,4G  0 crypt
    ├─vg3-swap    253:1    0   200G  0 lvm   [SWAP]
    └─vg3-root    253:2    0 731,4G  0 lvm   /
sdb                 8:16   0   3,7T  0 disk
└─MEGA            253:3    0   3,7T  0 crypt /mnt/MEGA
sdc                 8:32   0   5,5T  0 disk
└─sdc1              8:33   0   5,5T  0 part
  └─UBackup       253:4    0   5,5T  0 crypt
    └─vg4-UBackup 253:5    0   5,5T  0 lvm   /mnt/UBackup
 % sudo mount /dev/loop1 /mnt/Bellezatest
 % ls /mnt/Bellezatest
 Belleza_40.png   Belleza_RGB.png  'Goatsquirrel Belleza 40.png'                 'Goatsquirrel Belleza Cropped.png'
 Belleza.exr      Crash.jpg        'Goatsquirrel Belleza 40 Stereoscopic 2.png'
 % sudo btrfs device add /dev/loop2 /mnt/Bellezatest
 % sudo btrfs balance start -dconvert=raid0 -mconvert=raid1 /mnt/Bellezatest
zsh: segmentation fault  sudo btrfs balance start -dconvert=raid0 -mconvert=raid1 /mnt/Bellezatest
 % sudo btrfs balance start -dconvert=raid0 -mconvert=raid1 /mnt/Bellezatest
 % ls /mnt/Bellezatest
 Belleza_40.png   Belleza_RGB.png  'Goatsquirrel Belleza 40.png'                 'Goatsquirrel Belleza Cropped.png'
 Belleza.exr      Crash.jpg        'Goatsquirrel Belleza 40 Stereoscopic 2.png'
 % df -h
df: /run/user/1027/doc: Operacio ne permesatas
Dosiersistemo           Grando Uzata Liber Uza% Metita sur
udev                       10M  4,0K   10M   1% /dev
/dev/mapper/vg3-root      732G  692G   30G  96% /
tmpfs                     2,4G  2,3M  2,4G   1% /run
cgroup_root                10M     0   10M   0% /sys/fs/cgroup
shm                        12G  699M   12G   6% /dev/shm
/dev/mapper/MEGA          3,7T  3,5T  209G  95% /mnt/MEGA
/dev/mapper/vg4-UBackup   5,5T  4,8T  751G  87% /mnt/UBackup
/dev/mapper/vg2-root       23G   18G  4,2G  81% /mnt/vg2-root
none                       12G  8,0K   12G   1% /run/user/1027
/dev/loop1                2,0G  907M  3,6M 1 % sudo btrfs balance start -dconvert=raid0 -mconvert=raid1 /mnt/Bellezatest
ERROR: error during balancing '/mnt/Bellezatest': Operation now in progress
00% /mnt/Bellezatest
 % df -h
df: /run/user/1027/doc: Operacio ne permesatas
Dosiersistemo           Grando Uzata Liber Uza% Metita sur
udev                       10M  4,0K   10M   1% /dev
/dev/mapper/vg3-root      732G  692G   30G  96% /
tmpfs                     2,4G  2,3M  2,4G   1% /run
cgroup_root                10M     0   10M   0% /sys/fs/cgroup
shm                        12G  673M   12G   6% /dev/shm
/dev/mapper/MEGA          3,7T  3,5T  209G  95% /mnt/MEGA
/dev/mapper/vg4-UBackup   5,5T  4,8T  751G  87% /mnt/UBackup
/dev/mapper/vg2-root       23G   18G  4,2G  81% /mnt/vg2-root
none                       12G  8,0K   12G   1% /run/user/1027
/dev/loop1                2,0G  907M  3,6M 100% /mnt/Bellezatest
 % sudo btrfs balance start -dconvert=raid0 -mconvert=raid0 /mnt/Bellezatest
ERROR: error during balancing '/mnt/Bellezatest': Operation now in progress
 % sudo umount /mnt/Bellezatest

And now it is frozen not unmounting and with 0 disk activity. 

This is in my dmesg: 

[4914704.809383] ------------[ cut here ]------------
[4914704.809384] kernel BUG at fs/btrfs/relocation.c:3442!
[4914704.809389] invalid opcode: 0000 [#1] SMP PTI
[4914704.809393] CPU: 0 PID: 25998 Comm: btrfs Tainted: G        W         5.11.0-gentoo #1
[4914704.809396] Hardware name: Supermicro X8DT3/X8DT3, BIOS 2.1     03/17/2012
[4914704.809398] RIP: 0010:create_reloc_inode+0x109/0x240
[4914704.809405] Code: e8 2c b8 f8 ff 49 89 c6 48 85 c0 74 1d 4c 89 f9 48 89 c2 48 89 ee 4c 89 e7 e8 83 12 fa ff 85 c0 74 0a 4c 89 f7 e8 07 bc f8 ff <0f> 0b 49 63 46 40 ba 11 00 00 00 49 8b 1e 48 8d 04 80 48 8d 74 80
[4914704.809408] RSP: 0018:ffffc90007847d18 EFLAGS: 00010202
[4914704.809411] RAX: ffff888184dd9001 RBX: 0000000000000000 RCX: 0000000006abf955
[4914704.809413] RDX: 0000000006abf954 RSI: ffffffff816cb3c9 RDI: 00006079d0005f40
[4914704.809415] RBP: ffff8883ea92d000 R08: 00000000ffffffe4 R09: ffffffff8169dbe0
[4914704.809417] R10: 0000000000000001 R11: 0000000000000000 R12: ffff88807aa81ea0
[4914704.809418] R13: ffff88827db6a000 R14: ffff888184dd9b60 R15: 0000000000000101
[4914704.809420] FS:  00007fe56faac8c0(0000) GS:ffff888237a00000(0000) knlGS:0000000000000000
[4914704.809423] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[4914704.809425] CR2: 00007fdad236c718 CR3: 000000026cbd0000 CR4: 00000000000006f0
[4914704.809427] Call Trace:
[4914704.809430]  btrfs_relocate_block_group+0xf6/0x300
[4914704.809693]  btrfs_relocate_chunk+0x22/0xb0
[4914704.809698]  btrfs_balance+0x6f0/0xec0
[4914704.809891]  btrfs_ioctl_balance+0x2bb/0x370
[4914704.809898]  __x64_sys_ioctl+0x7e/0xb0
[4914704.809907]  do_syscall_64+0x33/0x40
[4914704.809912]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[4914704.809916] RIP: 0033:0x7fe56fba0587
[4914704.809919] Code: 00 00 90 48 8b 05 09 39 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d d9 38 0c 00 f7 d8 64 89 01 48
[4914704.809922] RSP: 002b:00007ffdd989e468 EFLAGS: 00000202 ORIG_RAX: 0000000000000010
[4914704.809924] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fe56fba0587
[4914704.809926] RDX: 00007ffdd989e500 RSI: 00000000c4009420 RDI: 0000000000000003
[4914704.809928] RBP: 0000000000000003 R08: 0000560549b3a2a0 R09: 0000000000000003
[4914704.809930] R10: 0000000000000000 R11: 0000000000000202 R12: 00007ffdd989fdb8
[4914704.809931] R13: 00007ffdd989e500 R14: 0000000000000001 R15: 00007ffdd989e500
[4914704.809934] Modules linked in: bpfilter uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common videodev mc btusb btrtl btbcm btintel virtio_crypto crypto_engine
[4914704.809949] ---[ end trace 5e5e801bd76aa527 ]---
[4914704.809952] RIP: 0010:create_reloc_inode+0x109/0x240
[4914704.809956] Code: e8 2c b8 f8 ff 49 89 c6 48 85 c0 74 1d 4c 89 f9 48 89 c2 48 89 ee 4c 89 e7 e8 83 12 fa ff 85 c0 74 0a 4c 89 f7 e8 07 bc f8 ff <0f> 0b 49 63 46 40 ba 11 00 00 00 49 8b 1e 48 8d 04 80 48 8d 74 80
[4914704.809959] RSP: 0018:ffffc90007847d18 EFLAGS: 00010202
[4914704.809962] RAX: ffff888184dd9001 RBX: 0000000000000000 RCX: 0000000006abf955
[4914704.809965] RDX: 0000000006abf954 RSI: ffffffff816cb3c9 RDI: 00006079d0005f40
[4914704.809967] RBP: ffff8883ea92d000 R08: 00000000ffffffe4 R09: ffffffff8169dbe0
[4914704.809970] R10: 0000000000000001 R11: 0000000000000000 R12: ffff88807aa81ea0
[4914704.809972] R13: ffff88827db6a000 R14: ffff888184dd9b60 R15: 0000000000000101
[4914704.809974] FS:  00007fe56faac8c0(0000) GS:ffff888237a00000(0000) knlGS:0000000000000000
[4914704.809976] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[4914704.809978] CR2: 00007fdad236c718 CR3: 000000026cbd0000 CR4: 00000000000006f0
[4914815.648634] ------------[ cut here ]------------
[4914815.648640] WARNING: CPU: 1 PID: 26561 at fs/namespace.c:1109 cleanup_mnt+0x150/0x180
[4914815.648647] Modules linked in: bpfilter uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common videodev mc btusb btrtl btbcm btintel virtio_crypto crypto_engine
[4914815.648660] CPU: 1 PID: 26561 Comm: umount Tainted: G      D W         5.11.0-gentoo #1
[4914815.648663] Hardware name: Supermicro X8DT3/X8DT3, BIOS 2.1     03/17/2012
[4914815.648664] RIP: 0010:cleanup_mnt+0x150/0x180
[4914815.648667] Code: fd ff 8b b5 1c 01 00 00 48 c7 c7 40 90 38 83 e8 86 0f 57 00 48 8d 7d 38 5b 48 c7 c6 80 e9 33 81 5d 41 5c 41 5d e9 30 85 eb ff <0f> 0b 48 83 bd 28 01 00 00 00 0f 84 f1 fe ff ff 48 89 ef e8 a8 88
[4914815.648670] RSP: 0018:ffffc90005737ed8 EFLAGS: 00010202
[4914815.648673] RAX: 0000000000000040 RBX: 0000000000000001 RCX: 0000000000000040
[4914815.648675] RDX: 0000000000ffffff RSI: 0000000000000000 RDI: 0000000000000040
[4914815.648677] RBP: ffff888259636140 R08: 0000000000000000 R09: 0000000000000040
[4914815.648678] R10: ffffffff83363f18 R11: ffff888237a68824 R12: ffff88813cf4d8dc
[4914815.648680] R13: ffff88813cf4d100 R14: 0000000000000000 R15: 0000000000000000
[4914815.648682] FS:  00007efe8fa72740(0000) GS:ffff888237a40000(0000) knlGS:0000000000000000
[4914815.648685] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[4914815.648686] CR2: 00007fdad236c718 CR3: 000000017382e000 CR4: 00000000000006e0
[4914815.648689] Call Trace:
[4914815.648692]  task_work_run+0x57/0x90
[4914815.648697]  exit_to_user_mode_prepare+0x10b/0x110
[4914815.648701]  syscall_exit_to_user_mode+0x1d/0x40
[4914815.648706]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[4914815.648709] RIP: 0033:0x7efe8fbbf537
[4914815.648712] Code: a9 0b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 29 a9 0b 00 f7 d8 64 89 01 48
[4914815.648714] RSP: 002b:00007ffde1298968 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
[4914815.648717] RAX: 0000000000000000 RBX: 000055970fce1440 RCX: 00007efe8fbbf537
[4914815.648719] RDX: 0000000000000001 RSI: 0000000000000000 RDI: 000055970fce1670
[4914815.648720] RBP: 0000000000000000 R08: 000055970fce1690 R09: 00007ffde12971a0
[4914815.648722] R10: 0000000000000000 R11: 0000000000000246 R12: 000055970fce1670
[4914815.648724] R13: 00007efe8fcddfa4 R14: 000055970fce1550 R15: 0000000000000000
[4914815.648727] ---[ end trace 5e5e801bd76aa528 ]---
Comment 4 Sid 2023-06-03 11:43:05 UTC
Just want to add that I am also having this issue. Please find my dmesg log below.
This was on a full-balance.

[ 1667.043961] kernel BUG at fs/btrfs/relocation.c:4391!
[ 1667.043966] invalid opcode: 0000 [#1] PREEMPT SMP PTI
[ 1667.043968] CPU: 2 PID: 3784 Comm: btrfs Tainted: P           O       6.1.31_1 #1
[ 1667.043970] Hardware name: Dell Inc. G7 7590/0CNDTP, BIOS 1.18.0 12/01/2021
[ 1667.043971] RIP: 0010:btrfs_reloc_cow_block+0x29f/0x2b0 [btrfs]
[ 1667.043999] Code: 24 28 48 8b 44 24 08 4d 89 73 70 49 89 42 30 49 89 72 38 4c 89 36 41 80 4a 71 20 e9 a2 fe ff ff 49 39 72 20 0f 84 49 fe ff ff <0f> 0b 41 0f b6 94 24 e8 05 00 00 e9 e8 fd ff ff 90 0f 1f 44 00 00
[ 1667.044001] RSP: 0018:ffff9cbe037037d0 EFLAGS: 00010287
[ 1667.044003] RAX: 0000000000000001 RBX: ffff893de9d60800 RCX: ffff89405b7c5800
[ 1667.044005] RDX: 0000000000000001 RSI: 000000cea83b8000 RDI: fffffffffffffff8
[ 1667.044006] RBP: ffff894023c91500 R08: 0000000000000001 R09: 0000000000000000
[ 1667.044007] R10: ffff893da866ad80 R11: ffff8940fe7fa000 R12: ffff8940c4466800
[ 1667.044008] R13: 0000000000000001 R14: 0000000000000001 R15: ffff893d82a123a8
[ 1667.044009] FS:  00007f97562aa900(0000) GS:ffff8940ee280000(0000) knlGS:0000000000000000
[ 1667.044011] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1667.044012] CR2: 000055c9503a0068 CR3: 00000002c0792003 CR4: 00000000003706e0
[ 1667.044014] Call Trace:
[ 1667.044016]  <TASK>
[ 1667.044017]  ? __die_body.cold+0x1a/0x1f
[ 1667.044021]  ? die+0x2a/0x50
[ 1667.044024]  ? do_trap+0xc5/0x110
[ 1667.044026]  ? btrfs_reloc_cow_block+0x29f/0x2b0 [btrfs]
[ 1667.044051]  ? do_error_trap+0x6a/0x90
[ 1667.044053]  ? btrfs_reloc_cow_block+0x29f/0x2b0 [btrfs]
[ 1667.044077]  ? exc_invalid_op+0x4c/0x60
[ 1667.044079]  ? btrfs_reloc_cow_block+0x29f/0x2b0 [btrfs]
[ 1667.044102]  ? asm_exc_invalid_op+0x16/0x20
[ 1667.044105]  ? btrfs_reloc_cow_block+0x29f/0x2b0 [btrfs]
[ 1667.044128]  ? update_ref_for_cow+0x22b/0x310 [btrfs]
[ 1667.044146]  __btrfs_cow_block+0x3c3/0x530 [btrfs]
[ 1667.044166]  btrfs_cow_block+0xf2/0x190 [btrfs]
[ 1667.044185]  btrfs_search_slot+0x542/0xc60 [btrfs]
[ 1667.044203]  ? select_reloc_root+0x258/0x2e0 [btrfs]
[ 1667.044228]  do_relocation+0xb0/0x650 [btrfs]
[ 1667.044252]  ? kmem_cache_free+0x15/0x310
[ 1667.044255]  ? select_one_root+0x2f/0x130 [btrfs]
[ 1667.044278]  ? preempt_count_add+0x6a/0xa0
[ 1667.044280]  ? _raw_spin_lock+0x13/0x40
[ 1667.044283]  relocate_tree_blocks+0x2ed/0x610 [btrfs]
[ 1667.044308]  relocate_block_group+0x3a2/0x4f0 [btrfs]
[ 1667.044332]  btrfs_relocate_block_group+0x22d/0x3f0 [btrfs]
[ 1667.044356]  btrfs_relocate_chunk+0x3b/0x120 [btrfs]
[ 1667.044379]  btrfs_balance+0x764/0xf30 [btrfs]
[ 1667.044405]  btrfs_ioctl+0x223f/0x25d0 [btrfs]
[ 1667.044430]  ? preempt_count_add+0x6a/0xa0
[ 1667.044431]  ? _raw_spin_lock+0x13/0x40
[ 1667.044434]  ? krc_this_cpu_lock+0x35/0x40
[ 1667.044436]  ? kvfree_call_rcu+0x242/0x320
[ 1667.044439]  __x64_sys_ioctl+0x8d/0xd0
[ 1667.044441]  do_syscall_64+0x58/0x80
[ 1667.044443]  ? __rseq_handle_notify_resume+0xa6/0x480
[ 1667.044446]  ? fpregs_assert_state_consistent+0x22/0x50
[ 1667.044449]  ? exit_to_user_mode_prepare+0x40/0x1b0
[ 1667.044451]  ? syscall_exit_to_user_mode+0x17/0x40
[ 1667.044453]  ? do_syscall_64+0x67/0x80
[ 1667.044454]  ? exit_to_user_mode_prepare+0x40/0x1b0
[ 1667.044456]  entry_SYSCALL_64_after_hwframe+0x63/0xcd
[ 1667.044458] RIP: 0033:0x7f9755f155ab
[ 1667.044460] Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <41> 89 c0 3d 00 f0 ff ff 77 1b 48 8b 44 24 18 64 48 2b 04 25 28 00
[ 1667.044462] RSP: 002b:00007ffe0c4fef80 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ 1667.044464] RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f9755f155ab
[ 1667.044465] RDX: 00007ffe0c4ff080 RSI: 00000000c4009420 RDI: 0000000000000003
[ 1667.044466] RBP: 0000000000000000 R08: 0000000000000013 R09: 00007f9755fa8760
[ 1667.044467] R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe0c500920
[ 1667.044468] R13: 00007ffe0c4ff080 R14: 0000000000000002 R15: 0000000000000000
[ 1667.044471]  </TASK>
[ 1667.044471] Modules linked in: ntfs3 sd_mod uas usb_storage rfcomm snd_seq_dummy snd_hrtimer ctr xt_CHECKSUM xt_MASQUERADE xt_tcpudp ip6table_mangle ip6table_nat iptable_mangle iptable_nat nf_nat bridge xfrm_interface xfrm6_tunnel tunnel4 tunnel6 bnep xfrm_user xfrm_algo ccm algif_aead des_generic libdes ip6t_REJECT nf_reject_ipv6 ip6table_filter ip6_tables algif_skcipher ipt_REJECT nf_reject_ipv4 xt_conntrack msr nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 cmac iptable_filter ip_tables md4 x_tables 8021q algif_hash garp mrp stp llc af_alg nls_iso8859_1 nls_cp437 vfat fat ext4 mbcache jbd2 btusb uvcvideo btrtl videobuf2_vmalloc btbcm videobuf2_memops btintel videobuf2_v4l2 btmtk videobuf2_common snd_hda_codec_hdmi joydev snd_sof_pci_intel_cnl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp snd_ctl_led snd_sof snd_sof_utils soundwire_bus snd_soc_skl snd_soc_hdac_hda snd_hda_ext_core snd_soc_sst_ipc
[ 1667.044512]  snd_soc_sst_dsp snd_hda_codec_realtek snd_soc_acpi_intel_match intel_tcc_cooling snd_soc_acpi x86_pkg_temp_thermal snd_hda_codec_generic intel_powerclamp snd_soc_core coretemp iwlmvm snd_compress snd_pcm_dmaengine ac97_bus nvidia_drm(PO) iTCO_wdt ee1004 kvm_intel snd_hda_intel intel_pmc_bxt i2c_designware_platform nvidia_modeset(PO) i2c_designware_core mei_pxp mei_hdcp iTCO_vendor_support mac80211 intel_rapl_msr snd_intel_dspcfg dell_laptop libarc4 snd_intel_sdw_acpi kvm snd_hda_codec iwlwifi dell_wmi ledtrig_audio processor_thermal_device_pci_legacy irqbypass intel_soc_dts_iosf dell_smbios snd_hda_core processor_thermal_device rapl dcdbas intel_cstate psmouse input_leds intel_lpss_pci nvidia(PO) processor_thermal_rfim i2c_i801 alienware_wmi dell_wmi_descriptor spi_intel_pci pcspkr wmi_bmof intel_wmi_thunderbolt intel_lpss snd_hwdep processor_thermal_mbox spi_intel mei_me tiny_power_button r8169 i2c_smbus idma64 processor_thermal_rapl i2c_nvidia_gpu realtek thunderbolt
[ 1667.044544]  cfg80211 snd_pcm mei i2c_ccgx_ucsi intel_rapl_common virt_dma intel_pch_thermal thermal int3403_thermal tpm_crb evdev int340x_thermal_zone mac_hid tpm_tis tpm_tis_core intel_hid int3400_thermal acpi_thermal_rel sparse_keymap ac acpi_pad v4l2loopback(O) videodev mc sg snd_seq snd_seq_device snd_timer snd soundcore vhost_vsock vmw_vsock_virtio_transport_common vsock vhost_net vhost vhost_iotlb tap uhid hci_vhci bluetooth ecdh_generic rfkill ecc crc16 vfio_iommu_type1 vfio uinput userio ppp_generic slhc tun loop nvram cuse fuse dm_crypt encrypted_keys trusted asn1_encoder tee tpm rng_core hid_generic usbmouse usbhid i915 intel_gtt drm_buddy i2c_algo_bit drm_display_helper cec rc_core drm_kms_helper syscopyarea sysfillrect crct10dif_pclmul ahci sysimgblt crc32_pclmul fb_sys_fops polyval_clmulni libahci polyval_generic gf128mul ttm xhci_pci xhci_pci_renesas ghash_clmulni_intel libata sha512_ssse3 drm i2c_hid_acpi scsi_mod xhci_hcd aesni_intel i2c_hid crypto_simd mxm_wmi cryptd
[ 1667.044587]  usbcore serio_raw scsi_common agpgart usb_common hid button battery video wmi pinctrl_cannonlake dm_mirror dm_region_hash dm_log dm_mod btrfs blake2b_generic xor raid6_pq libcrc32c crc32c_generic crc32c_intel
[ 1667.044603] ---[ end trace 0000000000000000 ]---
[ 1667.044604] RIP: 0010:btrfs_reloc_cow_block+0x29f/0x2b0 [btrfs]
[ 1667.044628] Code: 24 28 48 8b 44 24 08 4d 89 73 70 49 89 42 30 49 89 72 38 4c 89 36 41 80 4a 71 20 e9 a2 fe ff ff 49 39 72 20 0f 84 49 fe ff ff <0f> 0b 41 0f b6 94 24 e8 05 00 00 e9 e8 fd ff ff 90 0f 1f 44 00 00
[ 1667.044629] RSP: 0018:ffff9cbe037037d0 EFLAGS: 00010287
[ 1667.044631] RAX: 0000000000000001 RBX: ffff893de9d60800 RCX: ffff89405b7c5800
[ 1667.044632] RDX: 0000000000000001 RSI: 000000cea83b8000 RDI: fffffffffffffff8
[ 1667.044633] RBP: ffff894023c91500 R08: 0000000000000001 R09: 0000000000000000
[ 1667.044634] R10: ffff893da866ad80 R11: ffff8940fe7fa000 R12: ffff8940c4466800
[ 1667.044635] R13: 0000000000000001 R14: 0000000000000001 R15: ffff893d82a123a8
[ 1667.044636] FS:  00007f97562aa900(0000) GS:ffff8940ee280000(0000) knlGS:0000000000000000
[ 1667.044637] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1667.044638] CR2: 000055c9503a0068 CR3: 00000002c0792003 CR4: 00000000003706e0

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