node offset 0/32 bset u64s 0: invalid bkey format: field 2 too large: 4294967295 + 131072 > 4294967295 u64s 3 fields 64:0, 64:0, 32:131072, 0:0, 0:0, 0:0, btree topology error: bcachefs (loop0): flagging btree freespace lost data bcachefs (loop0): error reading btree root btree=freespace 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 dirents unreadable, must recover from scan bcachefs (loop0): bch2_get_scanned_nodes(): recovery btree=dirents 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 9aa2895aefce4bdf written 8 min_key POS_MIN durability: 1 ptr: 0:41:0 gen 0 done bcachefs (loop0): accounting_read... done bcachefs (loop0): alloc_read... done bcachefs (loop0): snapshots_read... done bcachefs (loop0): check_allocations... bcachefs (loop0): bucket 0:34 data type user ptr gen 0 missing in alloc btree while marking u64s 7 type extent 4099:1800:U32_MAX len 8 ver 0: durability: 1 crc: c_size 8 size 8 offset 0 nonce 0 csum none 0:0 compress incompressible ptr: 0:34:0 gen 0, fixing bcachefs (loop0): bucket 0:27 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 c6c25c03258c59c5 written 16 min_key POS_MIN durability: 1 ptr: 0:27:0 gen 0, fixing bcachefs (loop0): bucket 0:38 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 7589ab5e0c11cc7a written 24 min_key POS_MIN durability: 1 ptr: 0:38:0 gen 0, fixing bcachefs (loop0): bucket 0:41 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 9aa2895aefce4bdf written 8 min_key POS_MIN durability: 1 ptr: 0:41:0 gen 0, fixing bcachefs (loop0): bucket 0:31 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 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:32 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 ebb8d5a9e3463bdb written 16 min_key POS_MIN durability: 1 ptr: 0:32:0 gen 0, fixing bcachefs (loop0): bucket 0:28 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 28f61e078e70b95c written 16 min_key POS_MIN durability: 1 ptr: 0:28:0 gen 0, fixing bcachefs (loop0): bucket 0:37 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 4a8b0fa43a9980a6 written 24 min_key POS_MIN durability: 1 ptr: 0:37:0 gen 0, fixing done bcachefs (loop0): going read-write bcachefs (loop0): journal_replay... bcachefs (loop0): bch2_journal_replay(): error journal_shutdown bcachefs (loop0): bch2_fs_recovery(): error journal_shutdown bcachefs (loop0): bch2_fs_start(): error starting filesystem journal_shutdown bcachefs (loop0): shutting down bcachefs (loop0): shutdown complete bcachefs: bch2_fs_get_tree() error: journal_shutdown 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=none,compression=lz4,nojournal_transaction_names bcachefs (loop0): invalid journal entry, version=1.7: mi_btree_bitmap type=data_usage in superblock: invalid journal entry usage: bad size, fixing bcachefs (loop0): invalid journal entry, version=1.7: mi_btree_bitmap type=btree_root in superblock: invalid btree root journal entry: wrong number of keys, fixing bcachefs (loop0): recovering from clean shutdown, journal seq 10 bcachefs (loop0): Doing compatible version upgrade from 1.7: mi_btree_bitmap to 1.25: extent_flags running recovery passes: check_allocations,check_extents_to_backpointers,check_inodes BUG: sleeping function called from invalid context at ./include/linux/sched/mm.h:321 in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 5326, name: syz.0.0 preempt_count: 0, expected: 0 RCU nest depth: 1, expected: 0 3 locks held by syz.0.0/5326: #0: ffff8880564ba0e0 (&type->s_umount_key#47/1){+.+.}-{4:4}, at: alloc_super+0x221/0x9d0 fs/super.c:344 #1: ffff888053784210 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:161 [inline] #1: ffff888053784210 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:253 [inline] #1: ffff888053784210 (&c->btree_trans_barrier){.+.+}-{0:0}, at: __bch2_trans_get+0x7ed/0xd40 fs/bcachefs/btree_iter.c:3386 #2: ffffffff8ed3dfe0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:331 [inline] #2: ffffffff8ed3dfe0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline] #2: ffffffff8ed3dfe0 (rcu_read_lock){....}-{1:3}, at: bch2_bkey_pick_read_device+0x29c/0x19b0 fs/bcachefs/extents.c:144 CPU: 0 UID: 0 PID: 5326 Comm: syz.0.0 Not tainted 6.14.0-syzkaller-12456-gacc4d5ff0b61 #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 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 __might_resched+0x558/0x6c0 kernel/sched/core.c:8818 might_alloc include/linux/sched/mm.h:321 [inline] slab_pre_alloc_hook mm/slub.c:4102 [inline] slab_alloc_node mm/slub.c:4180 [inline] __do_kmalloc_node mm/slub.c:4330 [inline] __kmalloc_node_track_caller_noprof+0xd3/0x4d0 mm/slub.c:4350 __do_krealloc mm/slub.c:4908 [inline] krealloc_noprof+0x10f/0x300 mm/slub.c:4961 bch2_printbuf_make_room+0x1f1/0x350 fs/bcachefs/printbuf.c:59 bch2_prt_printf+0x269/0x6d0 fs/bcachefs/printbuf.c:186 bch2_log_msg_start fs/bcachefs/error.c:19 [inline] bch2_fs_trans_inconsistent fs/bcachefs/error.c:63 [inline] bch2_fs_inconsistent+0x143/0x220 fs/bcachefs/error.c:81 bch2_dev_rcu fs/bcachefs/sb-members.h:226 [inline] bch2_bkey_pick_read_device+0x95e/0x19b0 fs/bcachefs/extents.c:165 bch2_btree_node_read+0x7ac/0x29e0 fs/bcachefs/btree_io.c:1706 __bch2_btree_root_read fs/bcachefs/btree_io.c:1796 [inline] bch2_btree_root_read+0x656/0x7e0 fs/bcachefs/btree_io.c:1818 read_btree_roots+0x3d7/0xa80 fs/bcachefs/recovery.c:581 bch2_fs_recovery+0x28e4/0x3e20 fs/bcachefs/recovery.c:928 bch2_fs_start+0x2fb/0x610 fs/bcachefs/super.c:1060 bch2_fs_get_tree+0x113e/0x18f0 fs/bcachefs/fs.c:2253 vfs_get_tree+0x90/0x2b0 fs/super.c:1759 do_new_mount+0x2cf/0xb70 fs/namespace.c:3878 do_mount fs/namespace.c:4218 [inline] __do_sys_mount fs/namespace.c:4429 [inline] __se_sys_mount+0x38c/0x400 fs/namespace.c:4406 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:0x7f99fc38e90a 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:00007f99fd100e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f99fd100ef0 RCX: 00007f99fc38e90a RDX: 00002000000058c0 RSI: 0000200000005900 RDI: 00007f99fd100eb0 RBP: 00002000000058c0 R08: 00007f99fd100ef0 R09: 0000000001000000 R10: 0000000001000000 R11: 0000000000000246 R12: 0000200000005900 R13: 00007f99fd100eb0 R14: 0000000000005911 R15: 0000200000000340 bcachefs (loop0): pointer to nonexistent device 129 bcachefs (loop0): btree node read error: no device to read from at extents level 0/0 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq c6c25c03258c59c5 written 16 min_key POS_MIN durability: 0 ptr: 129:6912 gen 0 bcachefs (loop0): flagging btree extents lost data bcachefs (loop0): running explicit recovery pass check_topology (2), currently at recovery_pass_empty (0) bcachefs (loop0): running explicit recovery pass check_lrus (14), currently at recovery_pass_empty (0) bcachefs (loop0): running explicit recovery pass check_backpointers_to_extents (16), currently at recovery_pass_empty (0) bcachefs (loop0): running explicit recovery pass scan_for_btree_nodes (1), currently at recovery_pass_empty (0) bcachefs (loop0): error reading btree root btree=extents level=0: btree_node_read_error, fixing bcachefs (loop0): bcachefs (loop0): error validating btree node at btree alloc level 0/0 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq ac62141f8dc7e261 written 24 min_key POS_MIN durability: 1 ptr: 0:26:0 gen 0 node offset 8/24 bset u64s 375 bset byte offset 1336: keys out of order: u64s 9 type alloc_v4 281474976710683:1:0 len 0 ver 73014444032 > u64s 11 type alloc_v4 0:18:0 len 0 ver 0, fixing bcachefs (loop0): invalid bkey in btree_node btree=alloc level=0: u64s 9 type alloc_v4 281474976710683:1:0 len 0 ver 73014444032: gen 0 oldest_gen 0 data_type free journal_seq_nonempty 256 journal_seq_empty 0 need_discard 1 need_inc_gen 0 dirty_sectors 1 stripe_sectors 0 cached_sectors 0 stripe 0 stripe_redundancy 0 io_time[READ] 0 io_time[WRITE] 0 bp_start 8 bad val size (32 < 48), deleting bcachefs (loop0): btree_node_read_work: rewriting btree node at due to error btree=alloc level=0 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq ac62141f8dc7e261 written 24 min_key POS_MIN durability: 1 ptr: 0:26:0 gen 0 bcachefs (loop0): invalid bkey in btree_node btree=backpointers level=0: u64s 9 type backpointer 0:8921088:20672 len 0 ver 0: bucket=0:34:8 btree=extents level=0 data_type=user suboffset=0 len=8 gen=0 pos=536870913:24:U32_MAX nonzero snapshot, deleting bcachefs (loop0): flagging btree backpointers lost data bcachefs (loop0): running explicit recovery pass check_btree_backpointers (15), currently at recovery_pass_empty (0) bcachefs (loop0): error reading btree root btree=backpointers level=0: btree_node_read_error, fixing bcachefs (loop0): scan_for_btree_nodes... bcachefs (loop0): btree node scan found 3 nodes after overwrites done bcachefs (loop0): check_topology... bcachefs (loop0): btree root extents unreadable, must recover from scan bcachefs (loop0): bch2_get_scanned_nodes(): recovery btree=extents 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 c6c25c03258c59c5 written 16 min_key POS_MIN durability: 1 ptr: 0:27:0 gen 0 done bcachefs (loop0): accounting_read... done bcachefs (loop0): alloc_read... done bcachefs (loop0): snapshots_read... done bcachefs (loop0): check_allocations... bcachefs (loop0): btree ptr not marked in member info btree allocated bitmap u64s 11 type btree_ptr_v2 SPOS_MAX 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:26 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 ac62141f8dc7e261 written 24 min_key POS_MIN durability: 1 ptr: 0:26:0 gen 0, fixing bcachefs (loop0): btree ptr not marked in member info btree allocated bitmap u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 7589ab5e0c11cc7a written 24 min_key POS_MIN durability: 1 ptr: 0:38:0 gen 0, fixing bcachefs (loop0): bucket 0:38 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 7589ab5e0c11cc7a written 24 min_key POS_MIN durability: 1 ptr: 0:38:0 gen 0, fixing bcachefs (loop0): btree ptr not marked in member info btree allocated bitmap u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 9aa2895aefce4bdf written 24 min_key POS_MIN durability: 1 ptr: 0:41:0 gen 0, fixing bcachefs (loop0): bucket 0:41 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 9aa2895aefce4bdf written 24 min_key POS_MIN durability: 1 ptr: 0:41:0 gen 0, fixing bcachefs (loop0): btree ptr not marked in member info btree allocated bitmap 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: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): btree ptr not marked in member info btree allocated bitmap u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 234881024: seq ebb8d5a9e3463bdb written 16 min_key POS_MIN durability: 1 ptr: 0:32:0 gen 0, fixing bcachefs (loop0): bucket 0:32 data type btree ptr gen 0 missing in alloc btree while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 234881024: seq ebb8d5a9e3463bdb written 16 min_key POS_MIN durability: 1 ptr: 0:32:0 gen 0, fixing bcachefs (loop0): btree ptr not marked in member info btree allocated bitmap u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq e81e1ed936acf3df written 32 min_key POS_MIN durability: 1 ptr: 0:29:0 gen 0, fixing bcachefs (loop0): bucket 0:29 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 e81e1ed936acf3df written 32 min_key POS_MIN durability: 1 ptr: 0:29:0 gen 0, fixing bcachefs (loop0): bucket 0:2 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:6 gen 0 data type sb has wrong cached_sectors: got 4194304, should be 0, fixing bcachefs (loop0): bucket 0:17 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:17 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:18 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:18 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:19 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:19 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:20 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:20 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:21 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:21 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:22 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:22 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:23 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:23 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:24 gen 0 has wrong data_type: got free, should be journal, fixing bcachefs (loop0): bucket 0:24 gen 0 data type journal has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:26 gen 0 has wrong data_type: got free, should be btree, fixing bcachefs (loop0): bucket 0:26 gen 0 data type btree has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:28 gen 0 has wrong data_type: got btree, should be need_discard, fixing bcachefs (loop0): bucket 0:28 gen 0 data type need_discard has wrong dirty_sectors: got 256, should be 0, fixing bcachefs (loop0): bucket 0:29 gen 0 has wrong data_type: got free, should be btree, fixing bcachefs (loop0): bucket 0:29 gen 0 data type btree has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:32 gen 0 has wrong data_type: got free, should be btree, fixing bcachefs (loop0): bucket 0:32 gen 0 data type btree has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:34 gen 0 data type user has wrong dirty_sectors: got 16, should be 8, fixing bcachefs (loop0): bucket 0:35 gen 0 has wrong data_type: got free, should be btree, fixing bcachefs (loop0): bucket 0:35 gen 0 data type btree has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:37 gen 0 has wrong data_type: got btree, should be need_discard, fixing bcachefs (loop0): bucket 0:37 gen 0 data type need_discard has wrong dirty_sectors: got 256, should be 0, fixing bcachefs (loop0): bucket 0:38 gen 0 has wrong data_type: got free, should be btree, fixing bcachefs (loop0): bucket 0:38 gen 0 data type btree has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:41 gen 0 has wrong data_type: got free, should be btree, fixing bcachefs (loop0): bucket 0:41 gen 0 data type btree has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:120 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:120 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:121 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:121 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:122 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:122 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:123 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:123 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:124 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:124 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:125 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:125 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:126 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:126 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:127 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:127 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing done bcachefs (loop0): going read-write bcachefs (loop0): journal_replay... 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 8/128 buckets done bcachefs (loop0): check_inodes... bcachefs (loop0): inode 4096:4294967295 bi_subvol points to missing subvolume 2, fixing done bcachefs (loop0): resume_logged_ops... done bcachefs (loop0): delete_dead_inodes... done bcachefs (loop0): done starting filesystem syz.0.0 (5326) used greatest stack depth: 10024 bytes left