loop0: detected capacity change from 0 to 16384 bcachefs (loop0): starting version 1.13: inode_has_child_snapshots opts=metadata_checksum=none,data_checksum=none features: new_siphash,inline_data,new_extent_overwrite,btree_ptr_v2,new_varint,journal_no_flush,alloc_v2,extents_across_btree_nodes bcachefs (loop0): Using encoding defined by superblock: utf8-12.1.0 bcachefs (loop0): recovering from clean shutdown, journal seq 15 bcachefs (loop0): Doing compatible version upgrade from 1.13: inode_has_child_snapshots to 1.28: inode_has_case_insensitive running recovery passes: check_allocations,check_extents_to_backpointers,check_inodes bcachefs (loop0): btree node read error at btree alloc level 1/1 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 3a29d24e27fd9a2e written 65534 min_key R 0:0:16777215 durability: 1 ptr: 0:178:0 gen 0 loop0 node offset 16/65534: btree node data missing: expected 65534 sectors, found 16 loop0 btree validate error repair success (rewriting node) bcachefs (loop0): invalid bkey in btree_node btree=snapshots level=0: u64s 12 type snapshot 0:4294967295:0 len 0 ver 0: subvol parent 0 children 0 0 subvol 1 tree 1 depth 0 skiplist 0 4160749568 0 skiplist not normalized, deleting bcachefs (loop0): error reading btree root btree=snapshots level=0: btree_node_read_error, fixing bcachefs (loop0): error reading btree root btree=accounting level=0: btree_node_read_error, fixing bcachefs (loop0): check_topology... bcachefs (loop0): btree node with incorrect min_key at btree=alloc level=1: parent: u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 3a29d24e27fd9a2e written 65534 min_key R 0:0:16777215 durability: 1 ptr: 0:178:0 gen 0 next: u64s 11 type btree_ptr_v2 0:82:0 len 0 ver 0: seq af8d2de42da20fd1 written 16 min_key POS_MIN durability: 1 ptr: 0:141:0 gen 0, fixing bcachefs (loop0): set_node_min(): u64s 11 type btree_ptr_v2 0:82:0 len 0 ver 0: seq af8d2de42da20fd1 written 16 min_key POS_MIN durability: 1 ptr: 0:141:0 gen 0 -> 0:0:16777215 bcachefs (loop0): btree node with incorrect max_key at: btree=alloc level=1 parent: u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 3a29d24e27fd9a2e written 65534 min_key R 0:0:16777215 durability: 1 ptr: 0:178:0 gen 0 child: u64s 11 type btree_ptr_v2 0:457:0 len 0 ver 0: seq 8b809fa828a78833 written 24 min_key 0:82:1 durability: 1 ptr: 0:176:0 gen 0, fixing bcachefs (loop0): set_node_max(): u64s 11 type btree_ptr_v2 0:457:0 len 0 ver 0: seq 8b809fa828a78833 written 24 min_key 0:82:1 durability: 1 ptr: 0:176:0 gen 0 -> SPOS_MAX bcachefs (loop0): btree root with incorrect min_key: 0:0:16777215 btree=alloc level=1 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 3a29d24e27fd9a2e written 65534 min_key R 0:0:16777215 durability: 1 ptr: 0:178:0 gen 0 btree topology error: ------------[ cut here ]------------ kernel BUG at fs/bcachefs/btree_gc.c:528! Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI CPU: 0 UID: 0 PID: 5354 Comm: syz.0.0 Not tainted 6.17.0-rc1-syzkaller-00211-g90d970cade8e #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:bch2_btree_repair_topology_recurse+0x52dc/0x52e0 fs/bcachefs/btree_gc.c:528 Code: fd 90 0f 0b e8 25 f4 9a fd 90 0f 0b e8 1d f4 9a fd 90 0f 0b e8 15 f4 9a fd 90 0f 0b e8 0d f4 9a fd 90 0f 0b e8 05 f4 9a fd 90 <0f> 0b 66 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f RSP: 0018:ffffc9000d50ea60 EFLAGS: 00010283 RAX: ffffffff8424c73b RBX: 00000000fffff6e8 RCX: 0000000000100000 RDX: ffffc9000e342000 RSI: 0000000000062ed8 RDI: 0000000000062ed9 RBP: ffffc9000d50ef90 R08: ffffffff8fa3a237 R09: 1ffffffff1f47446 R10: dffffc0000000000 R11: fffffbfff1f47447 R12: ffff888011b75c00 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff888052f24000 FS: 00007fe7a82b56c0(0000) GS:ffff88808d210000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fff1c2defe4 CR3: 0000000043ffc000 CR4: 0000000000352ef0 Call Trace: bch2_check_topology+0x692/0xe00 fs/bcachefs/btree_gc.c:602 bch2_run_recovery_pass fs/bcachefs/recovery_passes.c:484 [inline] __bch2_run_recovery_passes+0x3bd/0x1060 fs/bcachefs/recovery_passes.c:539 bch2_run_recovery_passes+0x184/0x210 fs/bcachefs/recovery_passes.c:610 bch2_fs_recovery+0x2690/0x3a50 fs/bcachefs/recovery.c:1016 bch2_fs_start+0xaaf/0xda0 fs/bcachefs/super.c:1213 bch2_fs_get_tree+0xb39/0x1520 fs/bcachefs/fs.c:2488 vfs_get_tree+0x8f/0x2b0 fs/super.c:1815 do_new_mount+0x2a2/0x9e0 fs/namespace.c:3805 do_mount fs/namespace.c:4133 [inline] __do_sys_mount fs/namespace.c:4344 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4321 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe7a739038a 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:00007fe7a82b4e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fe7a82b4ef0 RCX: 00007fe7a739038a RDX: 00002000000000c0 RSI: 0000200000000000 RDI: 00007fe7a82b4eb0 RBP: 00002000000000c0 R08: 00007fe7a82b4ef0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000000000 R13: 00007fe7a82b4eb0 R14: 0000000000004972 R15: 0000200000000180 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:bch2_btree_repair_topology_recurse+0x52dc/0x52e0 fs/bcachefs/btree_gc.c:528 Code: fd 90 0f 0b e8 25 f4 9a fd 90 0f 0b e8 1d f4 9a fd 90 0f 0b e8 15 f4 9a fd 90 0f 0b e8 0d f4 9a fd 90 0f 0b e8 05 f4 9a fd 90 <0f> 0b 66 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f RSP: 0018:ffffc9000d50ea60 EFLAGS: 00010283 RAX: ffffffff8424c73b RBX: 00000000fffff6e8 RCX: 0000000000100000 RDX: ffffc9000e342000 RSI: 0000000000062ed8 RDI: 0000000000062ed9 RBP: ffffc9000d50ef90 R08: ffffffff8fa3a237 R09: 1ffffffff1f47446 R10: dffffc0000000000 R11: fffffbfff1f47447 R12: ffff888011b75c00 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff888052f24000 FS: 00007fe7a82b56c0(0000) GS:ffff88808d210000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fff1c2defe4 CR3: 0000000043ffc000 CR4: 0000000000352ef0