syzbot


kernel BUG in replace_file_extents

Status: upstream: reported on 2026/04/18 16:18
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+3e20d8f3d41bac5dc9a2@syzkaller.appspotmail.com
First crash: 6d21h, last: 1d10h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [btrfs?] kernel BUG in replace_file_extents 0 (1) 2026/04/18 16:18

Sample crash report:
BTRFS info (device loop0): balance: start -d -m
BTRFS info (device loop0): relocating block group 6881280 flags data|metadata
BTRFS info (device loop0): relocating block group 5242880 flags data|metadata
BTRFS info (device loop0): found 42 extents, stage: move data extents
------------[ cut here ]------------
kernel BUG at fs/btrfs/relocation.c:841!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 5344 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:get_new_location fs/btrfs/relocation.c:838 [inline]
RIP: 0010:replace_file_extents+0x1574/0x1590 fs/btrfs/relocation.c:941
Code: 2a 2c fe 49 8b 3e be 03 00 00 00 48 c7 c2 e0 ee 17 8c 44 89 e9 e8 1c 29 24 fd e8 f7 36 ff ff e9 a7 fc ff ff e8 4d 64 bf fd 90 <0f> 0b e8 45 64 bf fd 90 0f 0b e8 3d 64 bf fd 90 0f 0b e8 35 64 bf
RSP: 0018:ffffc90001496e80 EFLAGS: 00010287
RAX: ffffffff84067a73 RBX: ffff88804426d6e0 RCX: 0000000000100000
RDX: ffffc90020001000 RSI: 00000000000e36b6 RDI: 00000000000e36b7
RBP: ffffc90001497090 R08: ffffea0000d98a47 R09: 1ffffd40001b3148
R10: dffffc0000000000 R11: fffff940001b3149 R12: 0000000000000531
R13: ffff88803452b620 R14: 0000000000000e70 R15: 80c06030180c2811
FS:  00007f0d5887b6c0(0000) GS:ffff88808c812000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f55816462b0 CR3: 000000001f2ba000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 btrfs_force_cow_block+0xa4d/0x2450 fs/btrfs/ctree.c:532
 btrfs_cow_block+0x3c4/0xa90 fs/btrfs/ctree.c:699
 do_relocation+0xd2e/0x1920 fs/btrfs/relocation.c:2288
 relocate_tree_block fs/btrfs/relocation.c:2538 [inline]
 relocate_tree_blocks+0x11ee/0x2020 fs/btrfs/relocation.c:2645
 relocate_block_group+0x76f/0xe70 fs/btrfs/relocation.c:3570
 do_nonremap_reloc+0xa8/0x5b0 fs/btrfs/relocation.c:5250
 btrfs_relocate_block_group+0x7e6/0xc40 fs/btrfs/relocation.c:5416
 btrfs_relocate_chunk+0x115/0x820 fs/btrfs/volumes.c:3598
 __btrfs_balance+0x1db0/0x2ae0 fs/btrfs/volumes.c:4509
 btrfs_balance+0xaf3/0x11b0 fs/btrfs/volumes.c:4896
 btrfs_ioctl_balance+0x3d3/0x610 fs/btrfs/ioctl.c:3453
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:583
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f0d5799c819
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f0d5887afe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f0d57c16090 RCX: 00007f0d5799c819
RDX: 0000200000000180 RSI: 00000000c4009420 RDI: 0000000000000006
RBP: 00007f0d57a32c91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f0d57c16128 R14: 00007f0d57c16090 R15: 00007ffce2e4f468
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:get_new_location fs/btrfs/relocation.c:838 [inline]
RIP: 0010:replace_file_extents+0x1574/0x1590 fs/btrfs/relocation.c:941
Code: 2a 2c fe 49 8b 3e be 03 00 00 00 48 c7 c2 e0 ee 17 8c 44 89 e9 e8 1c 29 24 fd e8 f7 36 ff ff e9 a7 fc ff ff e8 4d 64 bf fd 90 <0f> 0b e8 45 64 bf fd 90 0f 0b e8 3d 64 bf fd 90 0f 0b e8 35 64 bf
RSP: 0018:ffffc90001496e80 EFLAGS: 00010287
RAX: ffffffff84067a73 RBX: ffff88804426d6e0 RCX: 0000000000100000
RDX: ffffc90020001000 RSI: 00000000000e36b6 RDI: 00000000000e36b7
RBP: ffffc90001497090 R08: ffffea0000d98a47 R09: 1ffffd40001b3148
R10: dffffc0000000000 R11: fffff940001b3149 R12: 0000000000000531
R13: ffff88803452b620 R14: 0000000000000e70 R15: 80c06030180c2811
FS:  00007f0d5887b6c0(0000) GS:ffff88808c812000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f55816462b0 CR3: 000000001f2ba000 CR4: 0000000000352ef0

Crashes (23):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/04/20 03:13 upstream bea8d77e45a8 303e2802 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/20 03:12 upstream bea8d77e45a8 303e2802 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/19 11:35 upstream faeab166167f 303e2802 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/18 21:28 upstream eb5249b12507 303e2802 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/18 16:58 upstream 8541d8f725c6 303e2802 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/18 16:54 upstream 8541d8f725c6 303e2802 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/18 16:45 upstream 8541d8f725c6 303e2802 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/18 16:42 upstream 8541d8f725c6 303e2802 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/18 16:39 upstream 8541d8f725c6 303e2802 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/17 23:26 upstream 43cfbdda5af6 24ecfc1e .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/17 17:18 upstream 43cfbdda5af6 24ecfc1e .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/17 17:17 upstream 43cfbdda5af6 24ecfc1e .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/17 09:01 upstream 3cd8b194bf34 de0a551d .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/17 02:15 upstream 3cd8b194bf34 de0a551d .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/14 22:43 upstream d60bc1401583 362d1323 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/14 19:09 upstream d60bc1401583 362d1323 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/14 16:36 upstream d60bc1401583 362d1323 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/14 16:20 upstream d60bc1401583 362d1323 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/14 16:19 upstream d60bc1401583 362d1323 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/14 16:18 upstream d60bc1401583 362d1323 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/14 16:17 upstream d60bc1401583 362d1323 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/14 16:16 upstream d60bc1401583 362d1323 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
2026/04/14 16:16 upstream d60bc1401583 362d1323 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in replace_file_extents
* Struck through repros no longer work on HEAD.