bcachefs (loop0): shutting down bcachefs (loop0): going read-only bcachefs (loop0): finished waiting for writes to stop bcachefs (loop0): flushing journal and stopping allocators, journal seq 1 ------------[ cut here ]------------ kernel BUG at fs/bcachefs/alloc_foreground.c:489! Oops: invalid opcode: 0000 [#1] PREEMPT SMP PTI CPU: 1 PID: 3308 Comm: syz.0.15 Not tainted 6.10.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 RIP: 0010:bch2_bucket_alloc_freelist fs/bcachefs/alloc_foreground.c:489 [inline] RIP: 0010:bch2_bucket_alloc_trans+0xfa7/0xfb0 fs/bcachefs/alloc_foreground.c:649 Code: 04 25 28 00 00 00 48 3b 84 24 40 02 00 00 75 1c 48 89 e8 48 81 c4 48 02 00 00 5b 41 5c 41 5d 41 5e 41 5f 5d c3 cc cc cc cc 90 <0f> 0b e8 b2 4d 41 01 66 90 90 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffffc90002db69b0 EFLAGS: 00010202 RAX: 0000000000000000 RBX: 0000000000000001 RCX: ffffffffffffffbd RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000038 RBP: ffffc90002db6c78 R08: ffff888102366000 R09: ffff888102366000 R10: ffffc90002db6c78 R11: 0000000000000000 R12: 0000000000000000 R13: ffff888102366000 R14: ffff888102714000 R15: 0000000000000000 FS: 00007f31b2e216c0(0000) GS:ffff888237d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000563a64def1b8 CR3: 0000000103fb4000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: bch2_bucket_alloc_set_trans+0x2a0/0x4f0 fs/bcachefs/alloc_foreground.c:810 __open_bucket_add_buckets+0x60a/0x920 fs/bcachefs/alloc_foreground.c:1058 open_bucket_add_buckets+0xcb/0x160 fs/bcachefs/alloc_foreground.c:1102 bch2_alloc_sectors_start_trans+0x579/0xc30 __bch2_btree_node_alloc fs/bcachefs/btree_update_interior.c:333 [inline] bch2_btree_reserve_get+0x2e3/0x680 fs/bcachefs/btree_update_interior.c:547 bch2_btree_update_start+0x5c6/0x810 fs/bcachefs/btree_update_interior.c:1245 bch2_btree_split_leaf+0x4e/0x1e0 fs/bcachefs/btree_update_interior.c:1851 bch2_trans_commit_error+0x217/0x630 fs/bcachefs/btree_trans_commit.c:961 __bch2_trans_commit+0x1c3e/0x1f70 fs/bcachefs/btree_trans_commit.c:1189 wb_flush_one fs/bcachefs/btree_write_buffer.c:183 [inline] bch2_btree_write_buffer_flush_locked+0x979/0x11a0 fs/bcachefs/btree_write_buffer.c:375 btree_write_buffer_flush_seq+0x2cf/0x350 fs/bcachefs/btree_write_buffer.c:510 bch2_btree_write_buffer_journal_flush+0x35/0x60 fs/bcachefs/btree_write_buffer.c:525 journal_flush_pins+0x21b/0x370 fs/bcachefs/journal_reclaim.c:553 journal_flush_done+0x4a/0xe0 fs/bcachefs/journal_reclaim.c:806 bch2_journal_flush_pins+0x14e/0x170 fs/bcachefs/journal_reclaim.c:839 bch2_journal_flush_all_pins fs/bcachefs/journal_reclaim.h:76 [inline] __bch2_fs_read_only+0x84/0x180 fs/bcachefs/super.c:277 bch2_fs_read_only+0x282/0x470 fs/bcachefs/super.c:357 __bch2_fs_stop+0x5f/0x260 fs/bcachefs/super.c:619 bch2_fs_stop fs/bcachefs/super.c:678 [inline] bch2_fs_open+0x469/0x530 fs/bcachefs/super.c:2161 bch2_mount fs/bcachefs/fs.c:1924 [inline] bch2_fs_get_tree+0x297/0x6b0 fs/bcachefs/fs.c:2088 vfs_get_tree+0x2a/0xf0 fs/super.c:1789 do_new_mount+0x15a/0x3a0 fs/namespace.c:3352 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount+0x14b/0x1c0 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xe0/0x220 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f31b1f7f79a Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f31b2e20e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f31b2e20ef0 RCX: 00007f31b1f7f79a RDX: 0000000020005b00 RSI: 0000000020005b40 RDI: 00007f31b2e20eb0 RBP: 0000000020005b00 R08: 00007f31b2e20ef0 R09: 0000000000000002 R10: 0000000000000002 R11: 0000000000000246 R12: 0000000020005b40 R13: 00007f31b2e20eb0 R14: 0000000000005b48 R15: 00000000200003c0 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+0xfa7/0xfb0 fs/bcachefs/alloc_foreground.c:649 Code: 04 25 28 00 00 00 48 3b 84 24 40 02 00 00 75 1c 48 89 e8 48 81 c4 48 02 00 00 5b 41 5c 41 5d 41 5e 41 5f 5d c3 cc cc cc cc 90 <0f> 0b e8 b2 4d 41 01 66 90 90 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffffc90002db69b0 EFLAGS: 00010202 RAX: 0000000000000000 RBX: 0000000000000001 RCX: ffffffffffffffbd RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000038 RBP: ffffc90002db6c78 R08: ffff888102366000 R09: ffff888102366000 R10: ffffc90002db6c78 R11: 0000000000000000 R12: 0000000000000000 R13: ffff888102366000 R14: ffff888102714000 R15: 0000000000000000 FS: 00007f31b2e216c0(0000) GS:ffff888237d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000563a64def1b8 CR3: 0000000103fb4000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400