loop0: detected capacity change from 0 to 32768 bcachefs (loop0): starting version 1.7: mi_btree_bitmap opts=errors=continue,metadata_checksum=none,data_checksum=crc64,compression=lz4,journal_flush_disabled,norecovery,nojournal_transaction_names,noexcl,reconstruct_alloc bcachefs (loop0): recovering from clean shutdown, journal seq 10 bcachefs (loop0): Version upgrade required: Version upgrade from 0.24: unwritten_extents to 1.7: mi_btree_bitmap incomplete Doing incompatible version upgrade from 0.24: unwritten_extents to 1.25: extent_flags running recovery passes: check_allocations,check_alloc_info,check_lrus,check_btree_backpointers,check_backpointers_to_extents,check_extents_to_backpointers,check_alloc_to_lru_refs,bucket_gens_init,check_snapshot_trees,check_snapshots,check_subvols,check_subvol_children,delete_dead_snapshots,check_inodes,check_extents,check_indirect_extents,check_dirents,check_xattrs,check_root,check_unreachable_inodes,check_subvolume_structure,check_directory_structure,check_nlinks,set_fs_needs_rebalance bcachefs (loop0): dropping and reconstructing all alloc info bcachefs (loop0): error validating btree node on loop0 at btree xattrs level 0/0 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 node offset 0/16: incorrect min_key: got 0:0:458752 should be POS_MIN bcachefs (loop0): running explicit recovery pass check_topology (2), currently at recovery_pass_empty (0) bcachefs (loop0): flagging btree xattrs lost data bcachefs (loop0): running explicit recovery pass scan_for_btree_nodes (1), currently at recovery_pass_empty (0) error reading btree root btree=xattrs level=0: btree_node_read_error, fixing bcachefs (loop0): scan_for_btree_nodes... bcachefs (loop0): btree node scan found 7 nodes after overwrites done bcachefs (loop0): check_topology... bcachefs (loop0): btree root xattrs unreadable, must recover from scan bcachefs (loop0): bch2_get_scanned_nodes(): recovery btree=xattrs level=0 POS_MIN - SPOS_MAX bcachefs (loop0): bch2_get_scanned_nodes(): recovering u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 2285c34bed0abe32 written 16 min_key 0:0:458752 durability: 1 ptr: 0:31:0 gen 0 bcachefs (loop0): bch2_get_scanned_nodes(): recovery btree=xattrs level=0 POS_MIN - 0:0:458751 btree node with incorrect min_key at btree=xattrs level=1: parent: u64s 5 type btree_ptr SPOS_MAX len 0 ver 0 next: u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 2285c34bed0abe32 written 16 min_key 0:0:458752 durability: 1 ptr: 0:31:0 gen 0, fixing bcachefs (loop0): set_node_min(): u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 2285c34bed0abe32 written 16 min_key 0:0:458752 durability: 1 ptr: 0:31:0 gen 0 -> POS_MIN done bcachefs (loop0): accounting_read... done bcachefs (loop0): alloc_read... done bcachefs (loop0): snapshots_read... done bcachefs (loop0): Fixed errors, running fsck a second time to verify fs is clean bcachefs (loop0): done starting filesystem bcachefs (loop0): btree_path_down(): fatal error node not found at pos 4098:6993427477446363429:U32_MAX within parent node u64s 5 type btree_ptr SPOS_MAX len 0 ver 0 bcachefs (loop0): fatal error - emergency read only netlink: 'syz.0.0': attribute type 11 has an invalid length. bcachefs (loop0): btree_path_down(): fatal error node not found at pos 536870913:5159715431275259989:U32_MAX within parent node u64s 5 type btree_ptr SPOS_MAX len 0 ver 0 bcachefs (loop0): pointer to nonexistent device 237 ------------[ cut here ]------------ unhandled error case in bch2_bkey_pick_read_device WARNING: CPU: 0 PID: 5328 at fs/bcachefs/extents.c:230 bch2_bkey_pick_read_device+0x17a5/0x1a00 fs/bcachefs/extents.c:230 Modules linked in: CPU: 0 UID: 0 PID: 5328 Comm: syz.0.0 Not tainted 6.14.0-syzkaller-10514-g7f2ff7b62617 #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_bkey_pick_read_device+0x17a5/0x1a00 fs/bcachefs/extents.c:230 Code: a1 84 57 fd e9 d0 fd ff ff e8 97 84 57 fd c6 05 95 39 dd 0b 01 90 48 c7 c7 a0 a9 93 8c 48 c7 c6 17 c2 5a 8e e8 4c 8f 16 fd 90 <0f> 0b 90 90 e9 bc fe ff ff e8 6d 84 57 fd e9 6e ff ff ff 89 d9 80 RSP: 0018:ffffc9000d475480 EFLAGS: 00010246 RAX: e6c1979303bba500 RBX: 0000000000000000 RCX: 0000000000100000 RDX: ffffc9000e6c2000 RSI: 0000000000005f9c RDI: 0000000000005f9d RBP: ffffc9000d4756b0 R08: ffffffff81827862 R09: 1ffff11003f847d2 R10: dffffc0000000000 R11: ffffed1003f847d3 R12: dffffc0000000000 R13: 1ffff92001a8eab8 R14: 0000000000000000 R15: 0000000000000000 FS: 00007fe4a70856c0(0000) GS:ffff88808c5b7000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fe49afff000 CR3: 00000000413d4000 CR4: 0000000000352ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __bch2_read_extent+0x3ab/0x4400 fs/bcachefs/io_read.c:962 bch2_read_extent fs/bcachefs/io_read.h:140 [inline] bchfs_read+0x2a88/0x3300 fs/bcachefs/fs-io-buffered.c:226 bch2_readahead+0xe7a/0x12d0 fs/bcachefs/fs-io-buffered.c:301 read_pages+0x193/0x590 mm/readahead.c:160 page_cache_ra_order+0xa37/0xca0 mm/readahead.c:515 filemap_get_pages+0x59f/0x1fc0 mm/filemap.c:2602 filemap_read+0x466/0x1260 mm/filemap.c:2713 bch2_read_iter+0x1179/0x14b0 fs/bcachefs/fs-io-direct.c:221 __kernel_read+0x532/0xa10 fs/read_write.c:528 integrity_kernel_read+0xb2/0x100 security/integrity/iint.c:28 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:480 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:511 [inline] ima_calc_file_hash+0xb22/0x1c10 security/integrity/ima/ima_crypto.c:568 ima_collect_measurement+0x52b/0xb20 security/integrity/ima/ima_api.c:293 process_measurement+0x13a3/0x1fe0 security/integrity/ima/ima_main.c:383 ima_file_check+0xdb/0x130 security/integrity/ima/ima_main.c:611 security_file_post_open+0xb9/0x280 security/security.c:3130 do_open fs/namei.c:3847 [inline] path_openat+0x2cf7/0x35d0 fs/namei.c:4004 do_filp_open+0x284/0x4e0 fs/namei.c:4031 do_sys_openat2+0x12b/0x1d0 fs/open.c:1429 do_sys_open fs/open.c:1444 [inline] __do_sys_openat fs/open.c:1460 [inline] __se_sys_openat fs/open.c:1455 [inline] __x64_sys_openat+0x249/0x2a0 fs/open.c:1455 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe4a618d169 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007fe4a7085038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fe4a63a5fa0 RCX: 00007fe4a618d169 RDX: 000000000004b142 RSI: 0000200000000140 RDI: ffffffffffffff9c RBP: 00007fe4a620e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fe4a63a5fa0 R15: 00007ffc34b61e78