syzbot


kernel BUG in reserve_bytes

Status: upstream: reported on 2025/11/05 22:52
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+feba382c68462d76be14@syzkaller.appspotmail.com
First crash: 9d08h, last: 23h24m
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [btrfs?] kernel BUG in reserve_bytes 1 (2) 2025/11/06 11:53

Sample crash report:
BTRFS info (device loop2): balance: start -d -m
assertion failed: !(ticket->bytes == 0 && ticket->error) :: 0, in fs/btrfs/space-info.c:1672
------------[ cut here ]------------
kernel BUG at fs/btrfs/space-info.c:1672!
Oops: invalid opcode: 0000 [#1] SMP KASAN PTI
CPU: 0 UID: 0 PID: 6695 Comm: syz.2.287 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
RIP: 0010:handle_reserve_ticket fs/btrfs/space-info.c:1672 [inline]
RIP: 0010:reserve_bytes+0x129e/0x1410 fs/btrfs/space-info.c:1865
Code: 0f 0b e8 05 39 cc fd 48 c7 c7 40 d8 b0 8b 48 c7 c6 60 e4 b0 8b 31 d2 48 c7 c1 20 d5 b0 8b 41 b8 88 06 00 00 e8 83 bc 32 fd 90 <0f> 0b f3 0f 1e fa 65 8b 1d f9 5b 80 0e bf 07 00 00 00 89 de e8 09
RSP: 0018:ffffc9001aab7560 EFLAGS: 00010246
RAX: 000000000000005c RBX: 0000000000000000 RCX: d3232ac355c6c400
RDX: ffffc9000c11b000 RSI: 000000000000d6e3 RDI: 000000000000d6e4
RBP: ffffc9001aab77a0 R08: ffffc9001aab7287 R09: 1ffff92003556e50
R10: dffffc0000000000 R11: fffff52003556e51 R12: ffff888028d4f000
R13: dffffc0000000000 R14: 00000000fffffffc R15: ffffc9001aab7600
FS:  00007f71fe5f66c0(0000) GS:ffff888125ecd000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f625b5fc270 CR3: 000000002f456000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 btrfs_reserve_metadata_bytes+0x28/0x150 fs/btrfs/space-info.c:1888
 btrfs_reserve_trans_metadata fs/btrfs/transaction.c:579 [inline]
 start_transaction+0x102c/0x1610 fs/btrfs/transaction.c:660
 create_reloc_inode+0x1f5/0x8d0 fs/btrfs/relocation.c:3734
 btrfs_relocate_block_group+0x508/0xc70 fs/btrfs/relocation.c:3945
 btrfs_relocate_chunk+0x12f/0x5c0 fs/btrfs/volumes.c:3427
 __btrfs_balance+0x1860/0x23f0 fs/btrfs/volumes.c:4200
 btrfs_balance+0xac2/0x11b0 fs/btrfs/volumes.c:4575
 btrfs_ioctl_balance+0x3d3/0x610 fs/btrfs/ioctl.c:3572
 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+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f720038f6c9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f71fe5f6038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f72005e5fa0 RCX: 00007f720038f6c9
RDX: 0000200000000440 RSI: 00000000c4009420 RDI: 0000000000000003
RBP: 00007f7200411f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f72005e6038 R14: 00007f72005e5fa0 R15: 00007ffca4ce7bc8
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:handle_reserve_ticket fs/btrfs/space-info.c:1672 [inline]
RIP: 0010:reserve_bytes+0x129e/0x1410 fs/btrfs/space-info.c:1865
Code: 0f 0b e8 05 39 cc fd 48 c7 c7 40 d8 b0 8b 48 c7 c6 60 e4 b0 8b 31 d2 48 c7 c1 20 d5 b0 8b 41 b8 88 06 00 00 e8 83 bc 32 fd 90 <0f> 0b f3 0f 1e fa 65 8b 1d f9 5b 80 0e bf 07 00 00 00 89 de e8 09
RSP: 0018:ffffc9001aab7560 EFLAGS: 00010246
RAX: 000000000000005c RBX: 0000000000000000 RCX: d3232ac355c6c400
RDX: ffffc9000c11b000 RSI: 000000000000d6e3 RDI: 000000000000d6e4
RBP: ffffc9001aab77a0 R08: ffffc9001aab7287 R09: 1ffff92003556e50
R10: dffffc0000000000 R11: fffff52003556e51 R12: ffff888028d4f000
R13: dffffc0000000000 R14: 00000000fffffffc R15: ffffc9001aab7600
FS:  00007f71fe5f66c0(0000) GS:ffff888125fcd000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f54f3b729e0 CR3: 000000002f456000 CR4: 00000000003526f0

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/11/10 08:15 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in reserve_bytes
2025/11/10 08:08 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in reserve_bytes
2025/11/09 09:50 linux-next 9c0826a5d9aa 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in reserve_bytes
2025/11/06 21:44 linux-next df5d79720b15 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in reserve_bytes
2025/11/06 08:49 linux-next df5d79720b15 a6c9c731 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in reserve_bytes
2025/11/01 22:41 linux-next 98bd8b16ae57 2c50b6a9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in reserve_bytes
* Struck through repros no longer work on HEAD.