bcachefs (loop0): shutdown by ioctl type 1 ------------[ cut here ]------------ kernel BUG at fs/bcachefs/journal.c:359! Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI CPU: 0 UID: 0 PID: 5334 Comm: syz.0.0 Not tainted 6.12.0-rc7-syzkaller-00070-g0a9b9d17f3a7 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 RIP: 0010:journal_entry_open fs/bcachefs/journal.c:359 [inline] RIP: 0010:__journal_res_get+0x24cb/0x2670 fs/bcachefs/journal.c:544 Code: 89 f9 80 e1 07 38 c1 0f 8c 0d fe ff ff e8 3d 5a c0 fd e9 03 fe ff ff e8 63 4a 89 07 e8 6e 7d 56 fd 90 0f 0b e8 66 7d 56 fd 90 <0f> 0b e8 5e 7d 56 fd 90 0f 0b e8 56 7d 56 fd 90 0f 0b e8 4e 7d 56 RSP: 0018:ffffc9000cfa71c0 EFLAGS: 00010283 RAX: ffffffff843e6caa RBX: 0000000000000002 RCX: 0000000000040000 RDX: ffffc9000d829000 RSI: 0000000000000848 RDI: 0000000000000849 RBP: ffffc9000cfa7490 R08: ffffffff843e4f14 R09: 1ffff1100a049567 R10: dffffc0000000000 R11: ffffed100a049568 R12: 0000000000000023 R13: 00000000003ffffe R14: ffff88805024a500 R15: 1ffff1100a049545 FS: 00007f212f59b6c0(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f212f59af98 CR3: 000000003c2e0000 CR4: 0000000000352ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: bch2_journal_res_get_slowpath+0xe6/0x710 fs/bcachefs/journal.c:606 bch2_journal_res_get+0x12b/0x1c0 fs/bcachefs/journal.h:382 bch2_journal_flush_seq_async+0x524/0x830 fs/bcachefs/journal.c:717 bch2_journal_flush_seq+0xe5/0x2b0 fs/bcachefs/journal.c:772 bch2_ioc_goingdown fs/bcachefs/fs-ioctl.c:361 [inline] bch2_fs_file_ioctl+0x1d17/0x28b0 fs/bcachefs/fs-ioctl.c:581 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xf9/0x170 fs/ioctl.c:893 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:0x7f212e77e719 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:00007f212f59b038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f212e936058 RCX: 00007f212e77e719 RDX: 0000000020000080 RSI: 000000008004587d RDI: 0000000000000004 RBP: 00007f212e7f175e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f212e936058 R15: 00007fff5924ac88 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:journal_entry_open fs/bcachefs/journal.c:359 [inline] RIP: 0010:__journal_res_get+0x24cb/0x2670 fs/bcachefs/journal.c:544 Code: 89 f9 80 e1 07 38 c1 0f 8c 0d fe ff ff e8 3d 5a c0 fd e9 03 fe ff ff e8 63 4a 89 07 e8 6e 7d 56 fd 90 0f 0b e8 66 7d 56 fd 90 <0f> 0b e8 5e 7d 56 fd 90 0f 0b e8 56 7d 56 fd 90 0f 0b e8 4e 7d 56 RSP: 0018:ffffc9000cfa71c0 EFLAGS: 00010283 RAX: ffffffff843e6caa RBX: 0000000000000002 RCX: 0000000000040000 RDX: ffffc9000d829000 RSI: 0000000000000848 RDI: 0000000000000849 RBP: ffffc9000cfa7490 R08: ffffffff843e4f14 R09: 1ffff1100a049567 R10: dffffc0000000000 R11: ffffed100a049568 R12: 0000000000000023 R13: 00000000003ffffe R14: ffff88805024a500 R15: 1ffff1100a049545 FS: 00007f212f59b6c0(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f212f59af98 CR3: 000000003c2e0000 CR4: 0000000000352ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400