BUG: sleeping function called from invalid context at include/linux/sched/mm.h:306
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 9532, name: syz-executor.4
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
4 locks held by syz-executor.4/9532:
#0: ffff88814bfa4b98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: do_writepages+0x1a8/0x640 mm/page-writeback.c:2551
#1: ffff88814bfa6990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0xfb4/0x14e0 fs/jbd2/transaction.c:461
#2: ffff888020ae8c88 (&ei->i_data_sem){++++}-{3:3}, at: ext4_map_blocks+0x707/0x18d0 fs/ext4/inode.c:616
#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: 9532 Comm: syz-executor.4 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_gfp include/linux/buffer_head.h:376 [inline]
ext4_ext_grow_indepth fs/ext4/extents.c:1334 [inline]
ext4_ext_create_new_leaf fs/ext4/extents.c:1435 [inline]
ext4_ext_insert_extent+0x1227/0x4130 fs/ext4/extents.c:2102
ext4_ext_map_blocks+0x134d/0x5be0 fs/ext4/extents.c:4307
ext4_map_blocks+0x779/0x18d0 fs/ext4/inode.c:623
mpage_map_one_extent fs/ext4/inode.c:2183 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2236 [inline]
ext4_do_writepages+0x153f/0x2f40 fs/ext4/inode.c:2703
ext4_writepages+0x304/0x770 fs/ext4/inode.c:2792
do_writepages+0x1a8/0x640 mm/page-writeback.c:2551
filemap_fdatawrite_wbc mm/filemap.c:393 [inline]
filemap_fdatawrite_wbc+0x147/0x1b0 mm/filemap.c:383
__filemap_fdatawrite_range+0xb8/0xf0 mm/filemap.c:426
ext4_alloc_da_blocks+0x1e8/0x270 fs/ext4/inode.c:3056
ext4_release_file+0x181/0x370 fs/ext4/file.c:158
__fput+0x27c/0xa90 fs/file_table.c:321
task_work_run+0x16f/0x270 kernel/task_work.c:179
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0xb0d/0x29f0 kernel/exit.c:871
do_group_exit+0xd4/0x2a0 kernel/exit.c:1021
get_signal+0x2315/0x25b0 kernel/signal.c:2874
arch_do_signal_or_restart+0x79/0x5c0 arch/x86/kernel/signal.c:306
exit_to_user_mode_loop kernel/entry/common.c:168 [inline]
exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204
irqentry_exit_to_user_mode+0x9/0x40 kernel/entry/common.c:310
exc_page_fault+0xc0/0x170 arch/x86/mm/fault.c:1593
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570
RIP: 0033:0x0
Code: Unable to access opcode bytes at 0xffffffffffffffd6.
RSP: 002b:0000000020000008 EFLAGS: 00010217
RAX: 0000000000000000 RBX: 00007f43f6babf80 RCX: 00007f43f6a8c169
RDX: 0000000020000040 RSI: 0000000020000000 RDI: 00000000d0022000
RBP: 00007f43f6ae7ca1 R08: 00000000200000c0 R09: 00000000200000c0
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000
R13: 00007ffc49f438cf R14: 00007f43f7774300 R15: 0000000000022000
------------[ cut here ]------------
Voluntary context switch within RCU read-side critical section!
WARNING: CPU: 1 PID: 9532 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: 9532 Comm: syz-executor.4 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:ffffc9001f0d6850 EFLAGS: 00010086
RAX: 0000000000000000 RBX: ffff8880b993d4c0 RCX: 0000000000000000
RDX: ffff8880375b0000 RSI: ffffffff814bc477 RDI: 0000000000000001
RBP: ffff8880375b0000 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 216e6f6974636573 R12: 0000000000000000
R13: ffff8880375b0000 R14: ffffffff8e7b28b0 R15: ffff8880b993c5c0
FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000563710254950 CR3: 000000014f426000 CR4: 00000000003506e0
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_wait_block_bitmap+0x1c6/0x280 fs/ext4/balloc.c:573
ext4_mb_init_cache+0x53e/0x13d0 fs/ext4/mballoc.c:1213
ext4_mb_load_buddy_gfp+0xc72/0x13e0 fs/ext4/mballoc.c:1511
ext4_mb_load_buddy fs/ext4/mballoc.c:1592 [inline]
ext4_mb_regular_allocator+0xc1d/0x3a40 fs/ext4/mballoc.c:2727
ext4_mb_new_blocks+0x1ff5/0x4790 fs/ext4/mballoc.c:5837
ext4_ext_map_blocks+0x1fdb/0x5be0 fs/ext4/extents.c:4286
ext4_map_blocks+0x779/0x18d0 fs/ext4/inode.c:623
mpage_map_one_extent fs/ext4/inode.c:2183 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2236 [inline]
ext4_do_writepages+0x153f/0x2f40 fs/ext4/inode.c:2703
ext4_writepages+0x304/0x770 fs/ext4/inode.c:2792
do_writepages+0x1a8/0x640 mm/page-writeback.c:2551
filemap_fdatawrite_wbc mm/filemap.c:393 [inline]
filemap_fdatawrite_wbc+0x147/0x1b0 mm/filemap.c:383
__filemap_fdatawrite_range+0xb8/0xf0 mm/filemap.c:426
ext4_alloc_da_blocks+0x1e8/0x270 fs/ext4/inode.c:3056
ext4_release_file+0x181/0x370 fs/ext4/file.c:158
__fput+0x27c/0xa90 fs/file_table.c:321
task_work_run+0x16f/0x270 kernel/task_work.c:179
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0xb0d/0x29f0 kernel/exit.c:871
do_group_exit+0xd4/0x2a0 kernel/exit.c:1021
get_signal+0x2315/0x25b0 kernel/signal.c:2874
arch_do_signal_or_restart+0x79/0x5c0 arch/x86/kernel/signal.c:306
exit_to_user_mode_loop kernel/entry/common.c:168 [inline]
exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204
irqentry_exit_to_user_mode+0x9/0x40 kernel/entry/common.c:310
exc_page_fault+0xc0/0x170 arch/x86/mm/fault.c:1593
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570
RIP: 0033:0x0
Code: Unable to access opcode bytes at 0xffffffffffffffd6.
RSP: 002b:0000000020000008 EFLAGS: 00010217
RAX: 0000000000000000 RBX: 00007f43f6babf80 RCX: 00007f43f6a8c169
RDX: 0000000020000040 RSI: 0000000020000000 RDI: 00000000d0022000
RBP: 00007f43f6ae7ca1 R08: 00000000200000c0 R09: 00000000200000c0
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000
R13: 00007ffc49f438cf R14: 00007f43f7774300 R15: 0000000000022000