loop0: detected capacity change from 0 to 32768 bcachefs (loop0): starting version 1.7: mi_btree_bitmap opts=metadata_checksum=none,data_checksum=none,compression=lz4,nojournal_transaction_names 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 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: ffff888011ce20e0 (&type->s_umount_key#47/1){+.+.}-{4:4}, at: alloc_super+0x221/0x9d0 fs/super.c:344 #1: ffff888053484210 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:161 [inline] #1: ffff888053484210 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:253 [inline] #1: ffff888053484210 (&c->btree_trans_barrier){.+.+}-{0:0}, at: __bch2_trans_get+0x7ed/0xd40 fs/bcachefs/btree_iter.c:3386 #2: ffffffff8ed3b560 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:331 [inline] #2: ffffffff8ed3b560 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline] #2: ffffffff8ed3b560 (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-11270-g08733088b566 #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:4089 [inline] slab_alloc_node mm/slub.c:4167 [inline] __do_kmalloc_node mm/slub.c:4317 [inline] __kmalloc_node_track_caller_noprof+0xd3/0x4d0 mm/slub.c:4337 __do_krealloc mm/slub.c:4895 [inline] krealloc_noprof+0x10f/0x300 mm/slub.c:4948 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:0x7f2452d8e90a 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:00007f2453b48e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f2453b48ef0 RCX: 00007f2452d8e90a RDX: 00002000000058c0 RSI: 0000200000005900 RDI: 00007f2453b48eb0 RBP: 00002000000058c0 R08: 00007f2453b48ef0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000005900 R13: 00007f2453b48eb0 R14: 00000000000058b6 R15: 0000200000000000 bcachefs (loop0): pointer to nonexistent device 2 inconsistency detected - emergency read only at journal seq 10 bcachefs (loop0): btree node read error: no device to read from at freespace level 0/0 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq e81e1ed936acf3df written 32 min_key POS_MIN durability: 0 ptr: 2:7424 gen 0 bcachefs (loop0): flagging btree freespace lost data bcachefs (loop0): running explicit recovery pass check_topology (2), currently at recovery_pass_empty (0) bcachefs (loop0): error reading btree root btree=freespace level=0: btree_node_read_error, fixing bcachefs (loop0): check_topology... done bcachefs (loop0): accounting_read... done bcachefs (loop0): alloc_read... done bcachefs (loop0): snapshots_read... done bcachefs (loop0): check_allocations... bcachefs (loop0): bucket 0:29 gen 0 has wrong data_type: got btree, should be need_discard, fixing bcachefs (loop0): bucket 0:29 gen 0 data type need_discard has wrong dirty_sectors: got 256, should be 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 syz.0.0 (5326) used greatest stack depth: 19312 bytes left