bcachefs (loop0): u64s 12 type alloc_v4 0:42:0 len 0 ver 0: gen 0 oldest_gen 0 data_type btree journal_seq_nonempty 7 journal_seq_empty 0 need_discard 1 need_inc_gen 1 dirty_sectors 256 stripe_sectors 0 cached_sectors 0 stripe 0 stripe_redundancy 0 io_time[READ] 1 io_time[WRITE] 1280 fragmentation 0 bp_start 7 incorrectly set at freespace:0:42:0 (free 0, genbits 0 should be 0), fixing ------------[ cut here ]------------ kernel BUG at fs/bcachefs/journal_reclaim.h:30! Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI CPU: 0 UID: 0 PID: 1037 Comm: kworker/u4:5 Not tainted 6.17.0-rc1-syzkaller-00014-g0e39a731820a #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: btree_node_rewrite async_btree_node_rewrite_work RIP: 0010:journal_seq_pin fs/bcachefs/journal_reclaim.h:30 [inline] RIP: 0010:bch2_journal_pin_set_locked+0x346/0x350 fs/bcachefs/journal_reclaim.c:422 Code: fe ff ff e8 3c 92 72 fd 48 c7 c7 e0 f5 78 8e 4c 89 e6 e8 bd 86 b3 00 e9 54 fe ff ff e8 23 92 72 fd 90 0f 0b e8 1b 92 72 fd 90 <0f> 0b e8 13 92 72 fd 90 0f 0b 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffffc9000256f6a0 EFLAGS: 00010293 RAX: ffffffff844d2945 RBX: ffff8880119ce108 RCX: ffff888032e4a440 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000005 R08: 0000000000000005 R09: 0000000000000004 R10: dffffc0000000000 R11: fffff520004adecc R12: dffffc0000000000 R13: 0000000000000000 R14: 0000000000000000 R15: ffff888054049800 FS: 0000000000000000(0000) GS:ffff88808d211000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000564f7dae2a38 CR3: 0000000051967000 CR4: 0000000000352ef0 Call Trace: bch2_journal_pin_copy+0x4c7/0x5b0 fs/bcachefs/journal_reclaim.c:463 bch2_btree_interior_update_will_free_node+0x478/0xef0 fs/bcachefs/btree_update_interior.c:1092 bch2_btree_node_rewrite+0x9ac/0x1120 fs/bcachefs/btree_update_interior.c:2275 bch2_btree_node_rewrite_key+0x273/0x320 fs/bcachefs/btree_update_interior.c:2312 async_btree_node_rewrite_work+0x110/0x4f0 fs/bcachefs/btree_update_interior.c:2369 process_one_work kernel/workqueue.c:3236 [inline] process_scheduled_works+0xade/0x17b0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x70e/0x8a0 kernel/kthread.c:463 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 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+0x346/0x350 fs/bcachefs/journal_reclaim.c:422 Code: fe ff ff e8 3c 92 72 fd 48 c7 c7 e0 f5 78 8e 4c 89 e6 e8 bd 86 b3 00 e9 54 fe ff ff e8 23 92 72 fd 90 0f 0b e8 1b 92 72 fd 90 <0f> 0b e8 13 92 72 fd 90 0f 0b 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffffc9000256f6a0 EFLAGS: 00010293 RAX: ffffffff844d2945 RBX: ffff8880119ce108 RCX: ffff888032e4a440 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000005 R08: 0000000000000005 R09: 0000000000000004 R10: dffffc0000000000 R11: fffff520004adecc R12: dffffc0000000000 R13: 0000000000000000 R14: 0000000000000000 R15: ffff888054049800 FS: 0000000000000000(0000) GS:ffff88808d211000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000564f7dae2a38 CR3: 0000000051967000 CR4: 0000000000352ef0