------------[ cut here ]------------ kernel BUG at fs/bcachefs/alloc_foreground.c:489! Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI CPU: 1 PID: 12674 Comm: syz-executor.4 Not tainted 6.10.0-rc4-syzkaller-00148-g50736169ecc8 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 RIP: 0010:bch2_bucket_alloc_freelist fs/bcachefs/alloc_foreground.c:489 [inline] RIP: 0010:bch2_bucket_alloc_trans+0x3ac8/0x3b30 fs/bcachefs/alloc_foreground.c:649 Code: 0e 78 f5 fd e9 07 c7 ff ff 44 89 f1 80 e1 07 38 c1 0f 8c fe fd ff ff 4c 89 f7 e8 a3 76 f5 fd e9 f1 fd ff ff e8 69 13 93 fd 90 <0f> 0b e8 61 13 93 fd 90 0f 0b e8 29 e6 79 07 f3 0f 1e fa e8 50 13 RSP: 0018:ffffc900036d53c0 EFLAGS: 00010246 RAX: ffffffff84031137 RBX: 0000000000000019 RCX: 0000000000040000 RDX: ffffc90004a22000 RSI: 000000000003ffff RDI: 0000000000040000 RBP: ffffc900036d5af0 R08: ffffffff8402e303 R09: 0000000000000000 R10: ffffc900036d59a8 R11: fffff520006dab3a R12: 0000000000000037 R13: dffffc0000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 00007f9e799716c0(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007faf204374a8 CR3: 000000005fe98000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: bch2_bucket_alloc_set_trans+0x4f9/0xcf0 fs/bcachefs/alloc_foreground.c:810 __open_bucket_add_buckets+0x11ed/0x1c80 fs/bcachefs/alloc_foreground.c:1058 open_bucket_add_buckets+0x174/0x230 fs/bcachefs/alloc_foreground.c:1102 bch2_alloc_sectors_start_trans+0xcaf/0x1f60 __bch2_btree_node_alloc fs/bcachefs/btree_update_interior.c:333 [inline] bch2_btree_reserve_get+0x5f5/0x18d0 fs/bcachefs/btree_update_interior.c:547 bch2_btree_update_start+0xe84/0x1500 fs/bcachefs/btree_update_interior.c:1245 bch2_btree_node_rewrite+0x1c0/0x1280 fs/bcachefs/btree_update_interior.c:2143 bch2_move_btree+0x7af/0xde0 fs/bcachefs/move.c:890 bch2_scan_old_btree_nodes+0x14b/0x3c0 fs/bcachefs/move.c:1020 bch2_fs_recovery+0x327d/0x3720 fs/bcachefs/recovery.c:910 bch2_fs_start+0x356/0x5b0 fs/bcachefs/super.c:1035 bch2_fs_open+0xa8d/0xdf0 fs/bcachefs/super.c:2127 bch2_mount+0x6b0/0x13a0 fs/bcachefs/fs.c:1919 legacy_get_tree+0xee/0x190 fs/fs_context.c:662 vfs_get_tree+0x90/0x2a0 fs/super.c:1780 do_new_mount+0x2be/0xb40 fs/namespace.c:3352 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f9e78c7e62a Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f9e79970ef8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f9e79970f80 RCX: 00007f9e78c7e62a RDX: 0000000020000040 RSI: 0000000020000fc0 RDI: 00007f9e79970f40 RBP: 0000000020000040 R08: 00007f9e79970f80 R09: 0000000000200001 R10: 0000000000200001 R11: 0000000000000202 R12: 0000000020000fc0 R13: 00007f9e79970f40 R14: 00000000000119fc R15: 00000000200001c0 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:bch2_bucket_alloc_freelist fs/bcachefs/alloc_foreground.c:489 [inline] RIP: 0010:bch2_bucket_alloc_trans+0x3ac8/0x3b30 fs/bcachefs/alloc_foreground.c:649