while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 2285c34bed0abe32 written 16 min_key POS_MIN durability: 1 ptr: 0:31:0 gen 0, fixing bcachefs (loop0): bucket 0:35 data type btree ptr gen 0 missing in alloc btree while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq c0bef60d07ceb940 written 16 min_key POS_MIN durability: 1 ptr: 0:35:0 gen 0, fixing bcachefs (loop0): bucket 0:26 data type btree ptr gen 0 missing in alloc btree while marking u64s 11 type btree_ptr_v2 U64_MAX:U64_MAX:4278386687 len 0 ver 0: seq ac62141f8dc7e261 written 24 min_key POS_MIN durability: 1 ptr: 0:26:0 gen 0, fixing bcachefs (loop0): bucket 0:42 data type btree ptr gen 0 missing in alloc btree while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 1db8f60c84bb244c written 8 min_key R U64_MAX:U64_MAX:4278386688 durability: 1 ptr: 0:42:0 gen 0, fixing done bcachefs (loop0): going read-write bcachefs (loop0): journal_replay... done bcachefs (loop0): check_alloc_info... bcachefs (loop0): hole in alloc btree missing in freespace btree device 0 buckets 33-34, fixing bcachefs (loop0): hole in alloc btree missing in freespace btree device 0 buckets 36-37, fixing bcachefs (loop0): hole in alloc btree missing in freespace btree device 0 buckets 41-42, fixing bcachefs (loop0): hole in alloc btree missing in freespace btree device 0 buckets 44-120, fixing done bcachefs (loop0): check_lrus... done bcachefs (loop0): check_btree_backpointers... done bcachefs (loop0): check_backpointers_to_extents... done bcachefs (loop0): check_extents_to_backpointers... bcachefs (loop0): scanning for missing backpointers in 4/128 buckets done bcachefs (loop0): check_alloc_to_lru_refs... bcachefs (loop0): missing fragmentation lru entry u64s 13 type alloc_v4 0:34:0 len 0 ver 0: gen 0 oldest_gen 0 data_type user journal_seq_nonempty 0 journal_seq_empty 0 need_discard 0 need_inc_gen 0 dirty_sectors 8 stripe_sectors 0 cached_sectors 0 stripe 0 stripe_redundancy 0 io_time[READ] 0 io_time[WRITE] 0 fragmentation 67108864 bp_start 8 , fixing done bcachefs (loop0): bucket_gens_init... done bcachefs (loop0): reconstruct_snapshots... bcachefs (loop0): snapshot node 4294967295 from tree 4294967295 missing, recreating ------------[ cut here ]------------ kernel BUG at fs/bcachefs/bkey_types.h:210! Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI CPU: 0 UID: 0 PID: 5316 Comm: syz.0.0 Not tainted 6.15.0-rc3-syzkaller-00342-g5bc1018675ec #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 RIP: 0010:bkey_s_c_to_subvolume fs/bcachefs/bkey_types.h:210 [inline] RIP: 0010:check_snapshot_exists fs/bcachefs/snapshot.c:882 [inline] RIP: 0010:bch2_reconstruct_snapshots+0x2197/0x21a0 fs/bcachefs/snapshot.c:999 Code: bb e1 fc e8 db 0f 0d 07 e8 46 28 77 fd e8 21 10 d9 fd 4c 89 e7 89 de e8 a7 bb e1 fc e8 32 28 77 fd 90 0f 0b e8 2a 28 77 fd 90 <0f> 0b 0f 1f 80 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffffc9000d3defc0 EFLAGS: 00010246 RAX: ffffffff844896a6 RBX: ffff88803ff3ce30 RCX: 0000000000100000 RDX: ffffc9000e4ba000 RSI: 00000000000fffff RDI: 0000000000100000 RBP: ffffc9000d3df340 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffffc9000d3df148 R13: ffff88803e999960 R14: 0000000000000001 R15: 1ffff11007d3332c FS: 00007fb0aa3f26c0(0000) GS:ffff88808d6cc000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005645806190d8 CR3: 0000000042be8000 CR4: 0000000000352ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: bch2_run_recovery_pass+0xdf/0x1d0 fs/bcachefs/recovery_passes.c:227 bch2_run_recovery_passes+0x2a0/0xdb0 fs/bcachefs/recovery_passes.c:280 bch2_fs_recovery+0x2399/0x37b0 fs/bcachefs/recovery.c:937 bch2_fs_start+0x70b/0xae0 fs/bcachefs/super.c:1083 bch2_fs_get_tree+0xd99/0x1340 fs/bcachefs/fs.c:2570 vfs_get_tree+0x8f/0x2b0 fs/super.c:1759 do_new_mount+0x24a/0xa40 fs/namespace.c:3884 do_mount fs/namespace.c:4224 [inline] __do_sys_mount fs/namespace.c:4435 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4412 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fb0a959010a 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:00007fb0aa3f1e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fb0aa3f1ef0 RCX: 00007fb0a959010a RDX: 00002000000000c0 RSI: 0000200000000000 RDI: 00007fb0aa3f1eb0 RBP: 00002000000000c0 R08: 00007fb0aa3f1ef0 R09: 0000000001810000 R10: 0000000001810000 R11: 0000000000000246 R12: 0000200000000000 R13: 00007fb0aa3f1eb0 R14: 000000000000599a R15: 0000200000000280 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:bkey_s_c_to_subvolume fs/bcachefs/bkey_types.h:210 [inline] RIP: 0010:check_snapshot_exists fs/bcachefs/snapshot.c:882 [inline] RIP: 0010:bch2_reconstruct_snapshots+0x2197/0x21a0 fs/bcachefs/snapshot.c:999 Code: bb e1 fc e8 db 0f 0d 07 e8 46 28 77 fd e8 21 10 d9 fd 4c 89 e7 89 de e8 a7 bb e1 fc e8 32 28 77 fd 90 0f 0b e8 2a 28 77 fd 90 <0f> 0b 0f 1f 80 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffffc9000d3defc0 EFLAGS: 00010246 RAX: ffffffff844896a6 RBX: ffff88803ff3ce30 RCX: 0000000000100000 RDX: ffffc9000e4ba000 RSI: 00000000000fffff RDI: 0000000000100000 RBP: ffffc9000d3df340 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffffc9000d3df148 R13: ffff88803e999960 R14: 0000000000000001 R15: 1ffff11007d3332c FS: 00007fb0aa3f26c0(0000) GS:ffff88808d6cc000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005645806190d8 CR3: 0000000042be8000 CR4: 0000000000352ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400