------------[ cut here ]------------ kernel BUG at fs/bcachefs/bkey.c:389! Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI CPU: 0 UID: 0 PID: 5317 Comm: kworker/0:4 Not tainted 6.12.0-rc6-syzkaller-00099-g7758b206117d #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: bcachefs_write_ref bch2_do_invalidates_work RIP: 0010:set_inc_field_lossy fs/bcachefs/bkey.c:389 [inline] RIP: 0010:bch2_bkey_pack_pos_lossy+0x1946/0x1990 fs/bcachefs/bkey.c:522 Code: 89 ef e8 7d 57 ed fd e9 dc f9 ff ff e8 b3 90 83 fd 90 0f 0b e8 ab 90 83 fd 90 0f 0b e8 a3 90 83 fd 90 0f 0b e8 9b 90 83 fd 90 <0f> 0b e8 93 90 83 fd 90 0f 0b e8 8b 90 83 fd 90 0f 0b e8 d3 ec b5 RSP: 0018:ffffc9000cf66a40 EFLAGS: 00010293 RAX: ffffffff841149c5 RBX: 000f000000000000 RCX: ffff88801fa40000 RDX: 0000000000000000 RSI: 00000000ffffffff RDI: 000f000000000000 RBP: ffffc9000cf66c78 R08: ffffffff8411383e R09: 0000000000000000 R10: 0000000000000000 R11: 0000000100000000 R12: 1ffff110084fc71b R13: ffff8880427e38c0 R14: 00000000ffffffff R15: 00000000ffffffff FS: 0000000000000000(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000564b577a6068 CR3: 000000003fffa000 CR4: 0000000000352ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: bch2_btree_node_iter_init+0x894/0x4280 fs/bcachefs/bset.c:1313 __btree_path_level_init fs/bcachefs/btree_iter.c:615 [inline] bch2_btree_path_level_init+0x4d2/0x9f0 fs/bcachefs/btree_iter.c:635 btree_path_lock_root fs/bcachefs/btree_iter.c:769 [inline] bch2_btree_path_traverse_one+0x10de/0x2940 fs/bcachefs/btree_iter.c:1183 bch2_btree_path_traverse fs/bcachefs/btree_iter.h:247 [inline] __bch2_btree_iter_peek fs/bcachefs/btree_iter.c:2210 [inline] bch2_btree_iter_peek_upto+0xb58/0x70e0 fs/bcachefs/btree_iter.c:2310 next_lru_key fs/bcachefs/alloc_background.c:2104 [inline] bch2_do_invalidates_work+0x8e6/0x27c0 fs/bcachefs/alloc_background.c:2138 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3310 worker_thread+0x870/0xd30 kernel/workqueue.c:3391 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:set_inc_field_lossy fs/bcachefs/bkey.c:389 [inline] RIP: 0010:bch2_bkey_pack_pos_lossy+0x1946/0x1990 fs/bcachefs/bkey.c:522 Code: 89 ef e8 7d 57 ed fd e9 dc f9 ff ff e8 b3 90 83 fd 90 0f 0b e8 ab 90 83 fd 90 0f 0b e8 a3 90 83 fd 90 0f 0b e8 9b 90 83 fd 90 <0f> 0b e8 93 90 83 fd 90 0f 0b e8 8b 90 83 fd 90 0f 0b e8 d3 ec b5 RSP: 0018:ffffc9000cf66a40 EFLAGS: 00010293 RAX: ffffffff841149c5 RBX: 000f000000000000 RCX: ffff88801fa40000 RDX: 0000000000000000 RSI: 00000000ffffffff RDI: 000f000000000000 RBP: ffffc9000cf66c78 R08: ffffffff8411383e R09: 0000000000000000 R10: 0000000000000000 R11: 0000000100000000 R12: 1ffff110084fc71b R13: ffff8880427e38c0 R14: 00000000ffffffff R15: 00000000ffffffff FS: 0000000000000000(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ff9a1af39a0 CR3: 0000000011ef0000 CR4: 0000000000352ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400