BUG: sleeping function called from invalid context at mm/util.c:761 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 11573, name: syz-executor.1 3 locks held by syz-executor.1/11573: #0: ffff8880296745f0 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0xe9/0x100 fs/file.c:990 #1: ffff88802a112460 (sb_writers#4){.+.+}-{0:0}, at: ksys_write+0x12d/0x250 fs/read_write.c:658 #2: ffff8880111cb870 (&mapping->private_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:359 [inline] #2: ffff8880111cb870 (&mapping->private_lock){+.+.}-{2:2}, at: __buffer_migrate_page+0x3a8/0xa80 mm/migrate.c:722 Preemption disabled at: [<0000000000000000>] 0x0 CPU: 0 PID: 11573 Comm: syz-executor.1 Not tainted 5.14.0-rc2-next-20210722-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105 ___might_sleep.cold+0x1f3/0x239 kernel/sched/core.c:9182 folio_copy+0x10c/0x1a0 mm/util.c:761 folio_migrate_copy+0x19/0x30 mm/migrate.c:619 __buffer_migrate_page+0x820/0xa80 mm/migrate.c:757 move_to_new_page+0x339/0xf00 mm/migrate.c:904 __unmap_and_move mm/migrate.c:1069 [inline] unmap_and_move mm/migrate.c:1210 [inline] migrate_pages+0x2867/0x3890 mm/migrate.c:1487 compact_zone+0x1abb/0x3860 mm/compaction.c:2393 compact_node+0x129/0x1f0 mm/compaction.c:2677 compact_nodes mm/compaction.c:2693 [inline] sysctl_compaction_handler+0x10e/0x160 mm/compaction.c:2711 proc_sys_call_handler+0x346/0x630 fs/proc/proc_sysctl.c:586 call_write_iter include/linux/fs.h:2152 [inline] new_sync_write+0x426/0x650 fs/read_write.c:518 vfs_write+0x75a/0xa40 fs/read_write.c:605 ksys_write+0x12d/0x250 fs/read_write.c:658 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x4665e9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f8b2fad3188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665e9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffc9875940f R14: 00007f8b2fad3300 R15: 0000000000022000 BUG: sleeping function called from invalid context at mm/util.c:761 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 11573, name: syz-executor.1 3 locks held by syz-executor.1/11573: #0: ffff8880296745f0 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0xe9/0x100 fs/file.c:990 #1: ffff88802a112460 (sb_writers#4){.+.+}-{0:0}, at: ksys_write+0x12d/0x250 fs/read_write.c:658 #2: ffff8880111cb870 (&mapping->private_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:359 [inline] #2: ffff8880111cb870 (&mapping->private_lock){+.+.}-{2:2}, at: __buffer_migrate_page+0x3a8/0xa80 mm/migrate.c:722 Preemption disabled at: [<0000000000000000>] 0x0 CPU: 1 PID: 11573 Comm: syz-executor.1 Tainted: G W 5.14.0-rc2-next-20210722-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105 ___might_sleep.cold+0x1f3/0x239 kernel/sched/core.c:9182 folio_copy+0x10c/0x1a0 mm/util.c:761 folio_migrate_copy+0x19/0x30 mm/migrate.c:619 __buffer_migrate_page+0x820/0xa80 mm/migrate.c:757 move_to_new_page+0x339/0xf00 mm/migrate.c:904 __unmap_and_move mm/migrate.c:1069 [inline] unmap_and_move mm/migrate.c:1210 [inline] migrate_pages+0x2867/0x3890 mm/migrate.c:1487 compact_zone+0x1abb/0x3860 mm/compaction.c:2393 compact_node+0x129/0x1f0 mm/compaction.c:2677 compact_nodes mm/compaction.c:2693 [inline] sysctl_compaction_handler+0x10e/0x160 mm/compaction.c:2711 proc_sys_call_handler+0x346/0x630 fs/proc/proc_sysctl.c:586 call_write_iter include/linux/fs.h:2152 [inline] new_sync_write+0x426/0x650 fs/read_write.c:518 vfs_write+0x75a/0xa40 fs/read_write.c:605 ksys_write+0x12d/0x250 fs/read_write.c:658 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x4665e9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f8b2fad3188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665e9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffc9875940f R14: 00007f8b2fad3300 R15: 0000000000022000