bucket 0:26 gen 0 data type btree has wrong dirty_sectors: got 524544, should be 256, fixing bucket 0:29 gen 0 has wrong data_type: got btree, should be need_discard, fixing bucket 0:29 gen 0 data type need_discard has wrong dirty_sectors: got 256, should be 0, fixing bucket 0:42 gen 0 has wrong data_type: got free, should be btree, fixing bucket 0:42 gen 0 data type btree has wrong dirty_sectors: got 0, should be 256, fixing done bcachefs (loop2): going read-write bcachefs (loop2): journal_replay... ------------[ cut here ]------------ kernel BUG at fs/bcachefs/journal_reclaim.h:30! Oops: invalid opcode: 0000 [#1] PREEMPT SMP PTI CPU: 1 PID: 3338 Comm: syz.2.15 Not tainted 6.10.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 RIP: 0010:journal_seq_pin fs/bcachefs/journal_reclaim.h:30 [inline] RIP: 0010:bch2_journal_pin_set_locked fs/bcachefs/journal_reclaim.c:377 [inline] RIP: 0010:bch2_journal_pin_set+0x2a8/0x2c0 fs/bcachefs/journal_reclaim.c:437 Code: 4c 89 e7 e8 6a e1 2a 00 48 8b 7c 24 08 48 83 c4 10 5b 41 5c 41 5d 41 5e 41 5f 5d e9 f2 7d 35 01 90 0f 0b 90 e9 2e ff ff ff 90 <0f> 0b 90 0f 0b 90 0f 0b 90 0f 0b 66 2e 0f 1f 84 00 00 00 00 00 0f RSP: 0018:ffffc90002ddf8a8 EFLAGS: 00010213 RAX: ffffffffffffffff RBX: ffff8881023f9000 RCX: ffffffff8194f901 RDX: ffffffff8194fb00 RSI: 0000000000000000 RDI: ffff888177aca8a8 RBP: 0000000000000601 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff888177aca3c0 R13: ffffffff8194f9e0 R14: ffff8881023f9140 R15: ffffffffffffffff FS: 00007fbd63ca86c0(0000) GS:ffff888237d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fbd62f619a0 CR3: 000000010f77e000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: bch2_journal_pin_add fs/bcachefs/journal_reclaim.h:48 [inline] bch2_btree_add_journal_pin fs/bcachefs/btree_trans_commit.c:273 [inline] bch2_btree_insert_key_leaf+0x22c/0x280 fs/bcachefs/btree_trans_commit.c:305 bch2_trans_commit_write_locked fs/bcachefs/btree_trans_commit.c:794 [inline] do_bch2_trans_commit fs/bcachefs/btree_trans_commit.c:919 [inline] __bch2_trans_commit+0x173f/0x1f70 fs/bcachefs/btree_trans_commit.c:1170 bch2_trans_commit fs/bcachefs/btree_update.h:183 [inline] bch2_journal_replay+0x71b/0xbc0 fs/bcachefs/recovery.c:311 bch2_run_recovery_pass fs/bcachefs/recovery_passes.c:183 [inline] bch2_run_recovery_passes+0xb9/0x220 fs/bcachefs/recovery_passes.c:226 bch2_fs_recovery+0x8bb/0x1170 fs/bcachefs/recovery.c:852 bch2_fs_start+0x1b9/0x270 fs/bcachefs/super.c:1023 bch2_fs_get_tree+0x2b5/0x640 fs/bcachefs/fs.c:1935 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:0x7fbd62f7ffba 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:00007fbd63ca7e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fbd63ca7ef0 RCX: 00007fbd62f7ffba RDX: 0000000020000000 RSI: 0000000020000080 RDI: 00007fbd63ca7eb0 RBP: 0000000020000000 R08: 00007fbd63ca7ef0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000080 R13: 00007fbd63ca7eb0 R14: 0000000000005988 R15: 00000000200001c0 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:journal_seq_pin fs/bcachefs/journal_reclaim.h:30 [inline] RIP: 0010:bch2_journal_pin_set_locked fs/bcachefs/journal_reclaim.c:377 [inline] RIP: 0010:bch2_journal_pin_set+0x2a8/0x2c0 fs/bcachefs/journal_reclaim.c:437 Code: 4c 89 e7 e8 6a e1 2a 00 48 8b 7c 24 08 48 83 c4 10 5b 41 5c 41 5d 41 5e 41 5f 5d e9 f2 7d 35 01 90 0f 0b 90 e9 2e ff ff ff 90 <0f> 0b 90 0f 0b 90 0f 0b 90 0f 0b 66 2e 0f 1f 84 00 00 00 00 00 0f RSP: 0018:ffffc90002ddf8a8 EFLAGS: 00010213 RAX: ffffffffffffffff RBX: ffff8881023f9000 RCX: ffffffff8194f901 RDX: ffffffff8194fb00 RSI: 0000000000000000 RDI: ffff888177aca8a8 RBP: 0000000000000601 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff888177aca3c0 R13: ffffffff8194f9e0 R14: ffff8881023f9140 R15: ffffffffffffffff FS: 00007fbd63ca86c0(0000) GS:ffff888237d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fbd62f619a0 CR3: 000000010f77e000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400