bcachefs (loop3): 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
BUG: sleeping function called from invalid context at ./include/linux/sched/mm.h:321
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 6354, name: syz.3.86
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
3 locks held by syz.3.86/6354:
#0: ffff88803283c0e0 (&type->s_umount_key#52/1){+.+.}-{4:4}, at: alloc_super+0x221/0x9d0 fs/super.c:344
#1: ffff88805be84210 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:161 [inline]
#1: ffff88805be84210 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:253 [inline]
#1: ffff88805be84210 (&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: 1 UID: 0 PID: 6354 Comm: syz.3.86 Not tainted 6.14.0-syzkaller-11270-g08733088b566 #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
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:0x7f04a038e90a
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:00007f04a11fde68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f04a11fdef0 RCX: 00007f04a038e90a
RDX: 0000200000000000 RSI: 0000200000000100 RDI: 00007f04a11fdeb0
RBP: 0000200000000000 R08: 00007f04a11fdef0 R09: 0000000000800800
R10: 0000000000800800 R11: 0000000000000246 R12: 0000200000000100
R13: 00007f04a11fdeb0 R14: 0000000000005970 R15: 0000200000000200
------------[ cut here ]------------
Voluntary context switch within RCU read-side critical section!
WARNING: CPU: 0 PID: 6354 at kernel/rcu/tree_plugin.h:332 rcu_note_context_switch+0x702/0x1060 kernel/rcu/tree_plugin.h:332
Modules linked in:
CPU: 0 UID: 0 PID: 6354 Comm: syz.3.86 Tainted: G W 6.14.0-syzkaller-11270-g08733088b566 #0 PREEMPT(full)
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
RIP: 0010:rcu_note_context_switch+0x702/0x1060 kernel/rcu/tree_plugin.h:332
Code: 00 e9 cc 00 00 00 41 83 fd 06 0f 84 92 00 00 00 e9 bd 00 00 00 c6 05 f9 ce 9e 0e 01 90 48 c7 c7 00 ff 4b 8c e8 6f 05 d9 ff 90 <0f> 0b 90 90 e9 36 fa ff ff 90 0f 0b 90 45 84 ff 0f 84 fc f9 ff ff
RSP: 0018:ffffc9000b4e6600 EFLAGS: 00010046
RAX: b482ed8cdb705600 RBX: ffff88802cc68444 RCX: 0000000000080000
RDX: ffffc9000c92c000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc9000b4e6750 R08: ffffffff81827732 R09: 1ffff110170c47d2
R10: dffffc0000000000 R11: ffffed10170c47d3 R12: ffff888124fe2000
R13: dffffc0000000000 R14: ffff88802cc68000 R15: 0000000000000000
FS: 00007f04a11fe6c0(0000) GS:ffff888124fe2000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055556698f5c8 CR3: 0000000033164000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__schedule+0x3b3/0x51f0 kernel/sched/core.c:6672
__schedule_loop kernel/sched/core.c:6845 [inline]
schedule+0x163/0x360 kernel/sched/core.c:6860
schedule_timeout+0xb1/0x2b0 kernel/time/sleep_timeout.c:75
___down_common kernel/locking/semaphore.c:229 [inline]
__down_common+0x373/0x830 kernel/locking/semaphore.c:250
down+0x84/0xc0 kernel/locking/semaphore.c:64
console_lock+0x145/0x1b0 kernel/printk/printk.c:2849
__bch2_print_string_as_lines fs/bcachefs/util.c:267 [inline]
bch2_print_string_as_lines+0x2d/0x140 fs/bcachefs/util.c:286
bch2_fs_trans_inconsistent fs/bcachefs/error.c:71 [inline]
bch2_fs_inconsistent+0x195/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:0x7f04a038e90a
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:00007f04a11fde68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f04a11fdef0 RCX: 00007f04a038e90a
RDX: 0000200000000000 RSI: 0000200000000100 RDI: 00007f04a11fdeb0
RBP: 0000200000000000 R08: 00007f04a11fdef0 R09: 0000000000800800
R10: 0000000000800800 R11: 0000000000000246 R12: 0000200000000100
R13: 00007f04a11fdeb0 R14: 0000000000005970 R15: 0000200000000200