BUG: sleeping function called from invalid context at include/linux/sched/mm.h:306 in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 4995, name: syz-fuzzer preempt_count: 0, expected: 0 RCU nest depth: 1, expected: 0 4 locks held by syz-fuzzer/4995: #0: ffff88814bcce460 (sb_writers#4){.+.+}-{0:0}, at: do_rmdir+0x1da/0x430 fs/namei.c:4241 #1: ffff88807831c000 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:810 [inline] #1: ffff88807831c000 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: do_rmdir+0x225/0x430 fs/namei.c:4245 #2: ffff888078230400 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: inode_lock include/linux/fs.h:775 [inline] #2: ffff888078230400 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: vfs_rmdir.part.0+0x63/0x5a0 fs/namei.c:4187 #3: ffffffff8c7991c0 (rcu_read_lock){....}-{1:2}, at: lru_gen_refault mm/workingset.c:293 [inline] #3: ffffffff8c7991c0 (rcu_read_lock){....}-{1:2}, at: workingset_refault+0x175/0x11e0 mm/workingset.c:528 CPU: 1 PID: 4995 Comm: syz-fuzzer Not tainted 6.4.0-rc1-next-20230512-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x136/0x150 lib/dump_stack.c:106 __might_resched+0x358/0x580 kernel/sched/core.c:10148 might_alloc include/linux/sched/mm.h:306 [inline] slab_pre_alloc_hook mm/slab.h:670 [inline] slab_alloc_node mm/slub.c:3433 [inline] slab_alloc mm/slub.c:3459 [inline] __kmem_cache_alloc_lru mm/slub.c:3466 [inline] kmem_cache_alloc+0x357/0x3b0 mm/slub.c:3475 kmem_cache_zalloc include/linux/slab.h:670 [inline] alloc_buffer_head+0x24/0x150 fs/buffer.c:3044 folio_alloc_buffers+0x2f2/0x810 fs/buffer.c:941 alloc_page_buffers fs/buffer.c:976 [inline] grow_dev_page fs/buffer.c:1084 [inline] grow_buffers fs/buffer.c:1130 [inline] __getblk_slow+0x612/0x1230 fs/buffer.c:1157 __getblk_gfp+0x72/0x80 fs/buffer.c:1452 sb_getblk include/linux/buffer_head.h:369 [inline] ext4_getblk+0x211/0x850 fs/ext4/inode.c:845 ext4_bread_batch+0x82/0x500 fs/ext4/inode.c:912 __ext4_find_entry+0x451/0x1050 fs/ext4/namei.c:1666 ext4_find_entry fs/ext4/namei.c:1746 [inline] ext4_rmdir fs/ext4/namei.c:3158 [inline] ext4_rmdir+0x371/0xef0 fs/ext4/namei.c:3137 vfs_rmdir.part.0+0x1b0/0x5a0 fs/namei.c:4198 vfs_rmdir fs/namei.c:4183 [inline] do_rmdir+0x3ae/0x430 fs/namei.c:4257 __do_sys_unlinkat fs/namei.c:4435 [inline] __se_sys_unlinkat fs/namei.c:4429 [inline] __x64_sys_unlinkat+0xef/0x130 fs/namei.c:4429 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x403ace Code: 48 89 6c 24 38 48 8d 6c 24 38 e8 0d 00 00 00 48 8b 6c 24 38 48 83 c4 40 c3 cc cc cc 49 89 f2 48 89 fa 48 89 ce 48 89 df 0f 05 <48> 3d 01 f0 ff ff 76 15 48 f7 d8 48 89 c1 48 c7 c0 ff ff ff ff 48 RSP: 002b:000000c001097850 EFLAGS: 00000202 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: ffffffffffffff9c RCX: 0000000000403ace RDX: 0000000000000200 RSI: 000000c023771290 RDI: ffffffffffffff9c RBP: 000000c001097890 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 R13: 0000000000000064 R14: 000000c000209040 R15: 000000c00005a800 ------------[ cut here ]------------ Voluntary context switch within RCU read-side critical section! WARNING: CPU: 1 PID: 4995 at kernel/rcu/tree_plugin.h:320 rcu_note_context_switch+0xbb9/0x1800 kernel/rcu/tree_plugin.h:320 Modules linked in: CPU: 1 PID: 4995 Comm: syz-fuzzer Tainted: G W 6.4.0-rc1-next-20230512-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 RIP: 0010:rcu_note_context_switch+0xbb9/0x1800 kernel/rcu/tree_plugin.h:320 Code: fd 04 68 00 4c 8b 4c 24 30 8b 4c 24 28 48 8b 54 24 20 e9 8f 03 00 00 48 c7 c7 c0 2a 4e 8a c6 05 73 2b f6 0c 01 e8 17 b5 dc ff <0f> 0b e9 4c f5 ff ff 81 e5 ff ff ff 7f 0f 84 d7 f6 ff ff 65 48 8b RSP: 0018:ffffc90003b2f768 EFLAGS: 00010086 RAX: 0000000000000000 RBX: ffff8880b993d4c0 RCX: 0000000000000000 RDX: ffff888014f55940 RSI: ffffffff814bc477 RDI: 0000000000000001 RBP: ffff888014f55940 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 216e6f6974636573 R12: 0000000000000000 R13: ffff888014f55940 R14: ffffffff8e7b28b0 R15: ffff8880b993c5c0 FS: 000000c00005a890(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fa92e325d38 CR3: 000000002ba2b000 CR4: 00000000003526e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __schedule+0x276/0x5790 kernel/sched/core.c:6569 schedule+0xde/0x1a0 kernel/sched/core.c:6745 io_schedule+0xbe/0x130 kernel/sched/core.c:8987 bit_wait_io+0x16/0xe0 kernel/sched/wait_bit.c:209 __wait_on_bit+0x64/0x180 kernel/sched/wait_bit.c:49 out_of_line_wait_on_bit+0xd9/0x110 kernel/sched/wait_bit.c:64 wait_on_bit_io include/linux/wait_bit.h:101 [inline] __wait_on_buffer+0x63/0x70 fs/buffer.c:123 wait_on_buffer include/linux/buffer_head.h:398 [inline] __ext4_find_entry+0x590/0x1050 fs/ext4/namei.c:1676 ext4_find_entry fs/ext4/namei.c:1746 [inline] ext4_rmdir fs/ext4/namei.c:3158 [inline] ext4_rmdir+0x371/0xef0 fs/ext4/namei.c:3137 vfs_rmdir.part.0+0x1b0/0x5a0 fs/namei.c:4198 vfs_rmdir fs/namei.c:4183 [inline] do_rmdir+0x3ae/0x430 fs/namei.c:4257 __do_sys_unlinkat fs/namei.c:4435 [inline] __se_sys_unlinkat fs/namei.c:4429 [inline] __x64_sys_unlinkat+0xef/0x130 fs/namei.c:4429 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x403ace Code: 48 89 6c 24 38 48 8d 6c 24 38 e8 0d 00 00 00 48 8b 6c 24 38 48 83 c4 40 c3 cc cc cc 49 89 f2 48 89 fa 48 89 ce 48 89 df 0f 05 <48> 3d 01 f0 ff ff 76 15 48 f7 d8 48 89 c1 48 c7 c0 ff ff ff ff 48 RSP: 002b:000000c001097850 EFLAGS: 00000202 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: ffffffffffffff9c RCX: 0000000000403ace RDX: 0000000000000200 RSI: 000000c023771290 RDI: ffffffffffffff9c RBP: 000000c001097890 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 R13: 0000000000000064 R14: 000000c000209040 R15: 000000c00005a800