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 65535 min_key R 0:0:536870911 durability: 1 ptr: 0:178:0 gen 0 loop0 node offset 16/65535: btree node data missing: expected 65535 sectors, found 16 loop0 btree validate error repair success (rewriting node) bcachefs (loop0): error reading btree root btree=backpointers 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 65535 min_key R 0:0:536870911 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:536870911 bcachefs (loop0): btree root with incorrect min_key: 0:0:536870911 btree=alloc level=1 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 3a29d24e27fd9a2e written 65535 min_key R 0:0:536870911 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 syzkaller #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 9f 9a fd 90 0f 0b e8 1d 9f 9a fd 90 0f 0b e8 15 9f 9a fd 90 0f 0b e8 0d 9f 9a fd 90 0f 0b e8 05 9f 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:ffffc9000d3e6a60 EFLAGS: 00010287 RAX: ffffffff84251f8b RBX: 00000000fffff6e8 RCX: 0000000000100000 RDX: ffffc9000e5b2000 RSI: 0000000000063c69 RDI: 0000000000063c6a RBP: ffffc9000d3e6f90 R08: ffffffff8fa3c137 R09: 1ffffffff1f47826 R10: dffffc0000000000 R11: fffffbfff1f47827 R12: ffff88803ef69100 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff888052d00000 FS: 00007f8db3cf56c0(0000) GS:ffff88808d20a000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f1606fbf000 CR3: 0000000043815000 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+0x92/0x2b0 fs/super.c:1815 do_new_mount+0x2a2/0x9e0 fs/namespace.c:3808 do_mount fs/namespace.c:4136 [inline] __do_sys_mount fs/namespace.c:4347 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4324 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:0x7f8db2d9034a 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:00007f8db3cf4e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f8db3cf4ef0 RCX: 00007f8db2d9034a RDX: 0000200000000040 RSI: 0000200000004940 RDI: 00007f8db3cf4eb0 RBP: 0000200000000040 R08: 00007f8db3cf4ef0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000004940 R13: 00007f8db3cf4eb0 R14: 0000000000004981 R15: 0000200000000080 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 9f 9a fd 90 0f 0b e8 1d 9f 9a fd 90 0f 0b e8 15 9f 9a fd 90 0f 0b e8 0d 9f 9a fd 90 0f 0b e8 05 9f 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:ffffc9000d3e6a60 EFLAGS: 00010287 RAX: ffffffff84251f8b RBX: 00000000fffff6e8 RCX: 0000000000100000 RDX: ffffc9000e5b2000 RSI: 0000000000063c69 RDI: 0000000000063c6a RBP: ffffc9000d3e6f90 R08: ffffffff8fa3c137 R09: 1ffffffff1f47826 R10: dffffc0000000000 R11: fffffbfff1f47827 R12: ffff88803ef69100 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff888052d00000 FS: 00007f8db3cf56c0(0000) GS:ffff88808d20a000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f1606fbf000 CR3: 0000000043815000 CR4: 0000000000352ef0