====================================================== WARNING: possible circular locking dependency detected 6.9.0-syzkaller-03117-gb850dc206a57 #0 Not tainted ------------------------------------------------------ kswapd0/88 is trying to acquire lock: ffff888069359858 (&xfs_nondir_ilock_class#3){++++}-{3:3}, at: xfs_can_free_eofblocks+0x645/0x910 fs/xfs/xfs_bmap_util.c:555 but task is already holding lock: ffffffff8e42a660 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat mm/vmscan.c:6782 [inline] ffffffff8e42a660 (fs_reclaim){+.+.}-{0:0}, at: kswapd+0xb20/0x30c0 mm/vmscan.c:7164 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (fs_reclaim){+.+.}-{0:0}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __fs_reclaim_acquire mm/page_alloc.c:3698 [inline] fs_reclaim_acquire+0x88/0x140 mm/page_alloc.c:3712 might_alloc include/linux/sched/mm.h:312 [inline] slab_pre_alloc_hook mm/slub.c:3819 [inline] slab_alloc_node mm/slub.c:3900 [inline] __do_kmalloc_node mm/slub.c:4038 [inline] __kmalloc+0xb7/0x4a0 mm/slub.c:4052 kmalloc include/linux/slab.h:632 [inline] xfs_attr_shortform_list+0x6f3/0x17a0 fs/xfs/xfs_attr_list.c:115 xfs_attr_list_ilocked fs/xfs/xfs_attr_list.c:527 [inline] xfs_attr_list+0x25b/0x350 fs/xfs/xfs_attr_list.c:547 xfs_vn_listxattr+0x1d2/0x2c0 fs/xfs/xfs_xattr.c:314 ovl_copy_xattr+0x174/0xb60 fs/overlayfs/copy_up.c:98 ovl_copy_up_metadata+0x24f/0xda0 fs/overlayfs/copy_up.c:650 ovl_copy_up_tmpfile fs/overlayfs/copy_up.c:870 [inline] ovl_do_copy_up fs/overlayfs/copy_up.c:976 [inline] ovl_copy_up_one fs/overlayfs/copy_up.c:1168 [inline] ovl_copy_up_flags+0x1eb7/0x4470 fs/overlayfs/copy_up.c:1223 ovl_link+0x85/0x320 fs/overlayfs/dir.c:703 vfs_link+0x4f5/0x690 fs/namei.c:4613 do_linkat+0x555/0x6f0 fs/namei.c:4683 __do_sys_link fs/namei.c:4717 [inline] __se_sys_link fs/namei.c:4715 [inline] __x64_sys_link+0x86/0xa0 fs/namei.c:4715 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&xfs_nondir_ilock_class#3){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 down_read_nested+0xb5/0xa50 kernel/locking/rwsem.c:1651 xfs_can_free_eofblocks+0x645/0x910 fs/xfs/xfs_bmap_util.c:555 xfs_inode_mark_reclaimable+0x1bb/0xf60 fs/xfs/xfs_icache.c:2149 destroy_inode fs/inode.c:311 [inline] evict+0x549/0x630 fs/inode.c:682 dispose_list fs/inode.c:700 [inline] prune_icache_sb+0x239/0x2f0 fs/inode.c:885 super_cache_scan+0x38c/0x4b0 fs/super.c:223 do_shrink_slab+0x705/0x1160 mm/shrinker.c:435 shrink_slab_memcg mm/shrinker.c:548 [inline] shrink_slab+0x883/0x14d0 mm/shrinker.c:626 shrink_node_memcgs mm/vmscan.c:5875 [inline] shrink_node+0x11f5/0x2d60 mm/vmscan.c:5908 kswapd_shrink_node mm/vmscan.c:6704 [inline] balance_pgdat mm/vmscan.c:6895 [inline] kswapd+0x1a25/0x30c0 mm/vmscan.c:7164 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(fs_reclaim); lock(&xfs_nondir_ilock_class#3); lock(fs_reclaim); rlock(&xfs_nondir_ilock_class#3); *** DEADLOCK *** 2 locks held by kswapd0/88: #0: ffffffff8e42a660 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat mm/vmscan.c:6782 [inline] #0: ffffffff8e42a660 (fs_reclaim){+.+.}-{0:0}, at: kswapd+0xb20/0x30c0 mm/vmscan.c:7164 #1: ffff8880767ae0e0 (&type->s_umount_key#90){++++}-{3:3}, at: super_trylock_shared fs/super.c:561 [inline] #1: ffff8880767ae0e0 (&type->s_umount_key#90){++++}-{3:3}, at: super_cache_scan+0x94/0x4b0 fs/super.c:196 stack backtrace: CPU: 0 PID: 88 Comm: kswapd0 Not tainted 6.9.0-syzkaller-03117-gb850dc206a57 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 down_read_nested+0xb5/0xa50 kernel/locking/rwsem.c:1651 xfs_can_free_eofblocks+0x645/0x910 fs/xfs/xfs_bmap_util.c:555 xfs_inode_mark_reclaimable+0x1bb/0xf60 fs/xfs/xfs_icache.c:2149 destroy_inode fs/inode.c:311 [inline] evict+0x549/0x630 fs/inode.c:682 dispose_list fs/inode.c:700 [inline] prune_icache_sb+0x239/0x2f0 fs/inode.c:885 super_cache_scan+0x38c/0x4b0 fs/super.c:223 do_shrink_slab+0x705/0x1160 mm/shrinker.c:435 shrink_slab_memcg mm/shrinker.c:548 [inline] shrink_slab+0x883/0x14d0 mm/shrinker.c:626 shrink_node_memcgs mm/vmscan.c:5875 [inline] shrink_node+0x11f5/0x2d60 mm/vmscan.c:5908 kswapd_shrink_node mm/vmscan.c:6704 [inline] balance_pgdat mm/vmscan.c:6895 [inline] kswapd+0x1a25/0x30c0 mm/vmscan.c:7164 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244