loop0: detected capacity change from 0 to 32768 ======================================================= WARNING: The mand mount option has been deprecated and and is ignored by this kernel. Remove the mand option from the mount to silence this warning. ======================================================= XFS (loop0): Mounting V5 Filesystem bfdc47fc-10d8-4eed-a562-11a831b3f791 XFS (loop0): Ending clean mount XFS (loop0): Quotacheck needed: Please wait. XFS (loop0): Quotacheck: Done. ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.0.0/5341 is trying to acquire lock: ffffffff8e051900 (fs_reclaim){+.+.}-{0:0}, at: might_alloc include/linux/sched/mm.h:317 [inline] ffffffff8e051900 (fs_reclaim){+.+.}-{0:0}, at: slab_pre_alloc_hook mm/slub.c:4904 [inline] ffffffff8e051900 (fs_reclaim){+.+.}-{0:0}, at: slab_alloc_node mm/slub.c:5239 [inline] ffffffff8e051900 (fs_reclaim){+.+.}-{0:0}, at: __kmalloc_cache_noprof+0x40/0x700 mm/slub.c:5771 but task is already holding lock: ffff88801228d018 (&xfs_nondir_ilock_class){++++}-{4:4}, at: xfs_ilock_for_iomap fs/xfs/xfs_iomap.c:789 [inline] ffff88801228d018 (&xfs_nondir_ilock_class){++++}-{4:4}, at: xfs_buffered_write_iomap_begin+0x4d1/0x1a70 fs/xfs/xfs_iomap.c:1793 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&xfs_nondir_ilock_class){++++}-{4:4}: down_write_nested+0x9d/0x200 kernel/locking/rwsem.c:1706 xfs_reclaim_inode fs/xfs/xfs_icache.c:1035 [inline] xfs_icwalk_process_inode fs/xfs/xfs_icache.c:1727 [inline] xfs_icwalk_ag+0x1229/0x1a90 fs/xfs/xfs_icache.c:1809 xfs_icwalk fs/xfs/xfs_icache.c:1857 [inline] xfs_reclaim_inodes_nr+0x1e3/0x260 fs/xfs/xfs_icache.c:1101 super_cache_scan+0x41b/0x4b0 fs/super.c:228 do_shrink_slab+0x6df/0x10d0 mm/shrinker.c:437 shrink_slab+0xd74/0x10d0 mm/shrinker.c:664 shrink_one+0x2d9/0x720 mm/vmscan.c:4921 shrink_many mm/vmscan.c:4982 [inline] lru_gen_shrink_node mm/vmscan.c:5060 [inline] shrink_node+0x2f7d/0x35b0 mm/vmscan.c:6047 kswapd_shrink_node mm/vmscan.c:6901 [inline] balance_pgdat mm/vmscan.c:7084 [inline] kswapd+0x145a/0x2820 mm/vmscan.c:7354 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x510/0xa50 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 -> #0 (fs_reclaim){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x15a6/0x2cf0 kernel/locking/lockdep.c:5237 lock_acquire+0x107/0x340 kernel/locking/lockdep.c:5868 __fs_reclaim_acquire mm/page_alloc.c:4301 [inline] fs_reclaim_acquire+0x72/0x100 mm/page_alloc.c:4315 might_alloc include/linux/sched/mm.h:317 [inline] slab_pre_alloc_hook mm/slub.c:4904 [inline] slab_alloc_node mm/slub.c:5239 [inline] __kmalloc_cache_noprof+0x40/0x700 mm/slub.c:5771 kmalloc_noprof include/linux/slab.h:957 [inline] iomap_fill_dirty_folios+0xf4/0x260 fs/iomap/buffered-io.c:1557 xfs_buffered_write_iomap_begin+0xa23/0x1a70 fs/xfs/xfs_iomap.c:1857 iomap_iter+0x5ef/0xeb0 fs/iomap/iter.c:110 iomap_zero_range+0x1cc/0xa30 fs/iomap/buffered-io.c:1590 xfs_zero_range+0x9a/0x100 fs/xfs/xfs_iomap.c:2289 xfs_reflink_remap_prep+0x398/0x720 fs/xfs/xfs_reflink.c:1699 xfs_file_remap_range+0x235/0x760 fs/xfs/xfs_file.c:1556 vfs_copy_file_range+0xd81/0x1370 fs/read_write.c:1598 __do_sys_copy_file_range fs/read_write.c:1681 [inline] __se_sys_copy_file_range+0x2fb/0x470 fs/read_write.c:1648 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&xfs_nondir_ilock_class); lock(fs_reclaim); lock(&xfs_nondir_ilock_class); lock(fs_reclaim); *** DEADLOCK *** 4 locks held by syz.0.0/5341: #0: ffff888042346420 (sb_writers#12){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2681 [inline] #0: ffff888042346420 (sb_writers#12){.+.+}-{0:0}, at: vfs_copy_file_range+0x9a1/0x1370 fs/read_write.c:1586 #1: ffff88801228d230 (&sb->s_type->i_mutex_key#24){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1027 [inline] #1: ffff88801228d230 (&sb->s_type->i_mutex_key#24){+.+.}-{4:4}, at: xfs_iolock_two_inodes_and_break_layout fs/xfs/xfs_inode.c:2716 [inline] #1: ffff88801228d230 (&sb->s_type->i_mutex_key#24){+.+.}-{4:4}, at: xfs_ilock2_io_mmap+0x214/0x7e0 fs/xfs/xfs_inode.c:2792 #2: ffff88801228d3d0 (mapping.invalidate_lock#3){++++}-{4:4}, at: filemap_invalidate_lock_two+0x3d/0x90 mm/filemap.c:1032 #3: ffff88801228d018 (&xfs_nondir_ilock_class){++++}-{4:4}, at: xfs_ilock_for_iomap fs/xfs/xfs_iomap.c:789 [inline] #3: ffff88801228d018 (&xfs_nondir_ilock_class){++++}-{4:4}, at: xfs_buffered_write_iomap_begin+0x4d1/0x1a70 fs/xfs/xfs_iomap.c:1793 stack backtrace: CPU: 0 UID: 0 PID: 5341 Comm: syz.0.0 Not tainted syzkaller #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_lvl+0xe8/0x150 lib/dump_stack.c:120 print_circular_bug+0x2e2/0x300 kernel/locking/lockdep.c:2043 check_noncircular+0x12e/0x150 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x15a6/0x2cf0 kernel/locking/lockdep.c:5237 lock_acquire+0x107/0x340 kernel/locking/lockdep.c:5868 __fs_reclaim_acquire mm/page_alloc.c:4301 [inline] fs_reclaim_acquire+0x72/0x100 mm/page_alloc.c:4315 might_alloc include/linux/sched/mm.h:317 [inline] slab_pre_alloc_hook mm/slub.c:4904 [inline] slab_alloc_node mm/slub.c:5239 [inline] __kmalloc_cache_noprof+0x40/0x700 mm/slub.c:5771 kmalloc_noprof include/linux/slab.h:957 [inline] iomap_fill_dirty_folios+0xf4/0x260 fs/iomap/buffered-io.c:1557 xfs_buffered_write_iomap_begin+0xa23/0x1a70 fs/xfs/xfs_iomap.c:1857 iomap_iter+0x5ef/0xeb0 fs/iomap/iter.c:110 iomap_zero_range+0x1cc/0xa30 fs/iomap/buffered-io.c:1590 xfs_zero_range+0x9a/0x100 fs/xfs/xfs_iomap.c:2289 xfs_reflink_remap_prep+0x398/0x720 fs/xfs/xfs_reflink.c:1699 xfs_file_remap_range+0x235/0x760 fs/xfs/xfs_file.c:1556 vfs_copy_file_range+0xd81/0x1370 fs/read_write.c:1598 __do_sys_copy_file_range fs/read_write.c:1681 [inline] __se_sys_copy_file_range+0x2fb/0x470 fs/read_write.c:1648 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f72eb78f7c9 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f72ec5dd038 EFLAGS: 00000246 ORIG_RAX: 0000000000000146 RAX: ffffffffffffffda RBX: 00007f72eb9e5fa0 RCX: 00007f72eb78f7c9 RDX: 0000000000000006 RSI: 0000000000000000 RDI: 0000000000000009 RBP: 00007f72eb813f91 R08: 0000000000400000 R09: 0000000000000000 R10: 00002000000000c0 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f72eb9e6038 R14: 00007f72eb9e5fa0 R15: 00007ffe951f6b58