====================================================== WARNING: possible circular locking dependency detected 6.11.0-rc2-syzkaller-00004-gb446a2dae984 #0 Not tainted ------------------------------------------------------ kswapd0/90 is trying to acquire lock: ffff88802d440920 (&(imap->im_aglock[index])){+.+.}-{3:3}, at: diFree+0x37c/0x2fb0 fs/jfs/jfs_imap.c:889 but task is already holding lock: ffffffff8e82e3e0 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat mm/vmscan.c:6841 [inline] ffffffff8e82e3e0 (fs_reclaim){+.+.}-{0:0}, at: kswapd+0xb06/0x2e80 mm/vmscan.c:7223 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (fs_reclaim){+.+.}-{0:0}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5759 __fs_reclaim_acquire mm/page_alloc.c:3823 [inline] fs_reclaim_acquire+0x88/0x140 mm/page_alloc.c:3837 might_alloc include/linux/sched/mm.h:334 [inline] prepare_alloc_pages+0x147/0x5d0 mm/page_alloc.c:4471 __alloc_pages_noprof+0x166/0x6c0 mm/page_alloc.c:4689 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] ___kmalloc_large_node+0x8b/0x1d0 mm/slub.c:4103 __kmalloc_large_noprof+0x1f/0x80 mm/slub.c:4120 kmalloc_noprof include/linux/slab.h:678 [inline] diMount+0x29/0x870 fs/jfs/jfs_imap.c:105 jfs_mount_rw+0x2da/0x6a0 fs/jfs/jfs_mount.c:240 jfs_remount+0x3d1/0x6b0 fs/jfs/super.c:454 reconfigure_super+0x445/0x880 fs/super.c:1083 vfs_cmd_reconfigure fs/fsopen.c:263 [inline] vfs_fsconfig_locked fs/fsopen.c:292 [inline] __do_sys_fsconfig fs/fsopen.c:473 [inline] __se_sys_fsconfig+0xb6e/0xf80 fs/fsopen.c:345 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&jfs_ip->rdwrlock/1){++++}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5759 down_read_nested+0xb5/0xa50 kernel/locking/rwsem.c:1651 diAlloc+0x797/0x1760 fs/jfs/jfs_imap.c:1388 ialloc+0x8f/0x900 fs/jfs/jfs_inode.c:56 jfs_create+0x1be/0xbb0 fs/jfs/namei.c:92 lookup_open fs/namei.c:3578 [inline] open_last_lookups fs/namei.c:3647 [inline] path_openat+0x1a9a/0x3470 fs/namei.c:3883 do_filp_open+0x235/0x490 fs/namei.c:3913 do_sys_openat2+0x13e/0x1d0 fs/open.c:1416 do_sys_open fs/open.c:1431 [inline] __do_sys_open fs/open.c:1439 [inline] __se_sys_open fs/open.c:1435 [inline] __x64_sys_open+0x225/0x270 fs/open.c:1435 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&(imap->im_aglock[index])){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3133 [inline] check_prevs_add kernel/locking/lockdep.c:3252 [inline] validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3868 __lock_acquire+0x137a/0x2040 kernel/locking/lockdep.c:5142 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5759 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 diFree+0x37c/0x2fb0 fs/jfs/jfs_imap.c:889 jfs_evict_inode+0x32d/0x440 fs/jfs/inode.c:156 evict+0x2a8/0x630 fs/inode.c:669 __dentry_kill+0x20d/0x630 fs/dcache.c:610 shrink_kill+0xa9/0x2c0 fs/dcache.c:1055 shrink_dentry_list+0x2c0/0x5b0 fs/dcache.c:1082 prune_dcache_sb+0x10f/0x180 fs/dcache.c:1163 super_cache_scan+0x34f/0x4b0 fs/super.c:221 do_shrink_slab+0x701/0x1160 mm/shrinker.c:435 shrink_slab_memcg mm/shrinker.c:548 [inline] shrink_slab+0x878/0x14c0 mm/shrinker.c:626 shrink_node_memcgs mm/vmscan.c:5910 [inline] shrink_node+0x130f/0x2df0 mm/vmscan.c:5948 kswapd_shrink_node mm/vmscan.c:6762 [inline] balance_pgdat mm/vmscan.c:6954 [inline] kswapd+0x191b/0x2e80 mm/vmscan.c:7223 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: Chain exists of: &(imap->im_aglock[index]) --> &jfs_ip->rdwrlock/1 --> fs_reclaim Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(fs_reclaim); lock(&jfs_ip->rdwrlock/1); lock(fs_reclaim); lock(&(imap->im_aglock[index])); *** DEADLOCK *** 2 locks held by kswapd0/90: #0: ffffffff8e82e3e0 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat mm/vmscan.c:6841 [inline] #0: ffffffff8e82e3e0 (fs_reclaim){+.+.}-{0:0}, at: kswapd+0xb06/0x2e80 mm/vmscan.c:7223 #1: ffff88807d1ae0e0 (&type->s_umount_key#103){++++}-{3:3}, at: super_trylock_shared fs/super.c:562 [inline] #1: ffff88807d1ae0e0 (&type->s_umount_key#103){++++}-{3:3}, at: super_cache_scan+0x94/0x4b0 fs/super.c:196 stack backtrace: CPU: 0 UID: 0 PID: 90 Comm: kswapd0 Not tainted 6.11.0-rc2-syzkaller-00004-gb446a2dae984 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2186 check_prev_add kernel/locking/lockdep.c:3133 [inline] check_prevs_add kernel/locking/lockdep.c:3252 [inline] validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3868 __lock_acquire+0x137a/0x2040 kernel/locking/lockdep.c:5142 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5759 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 diFree+0x37c/0x2fb0 fs/jfs/jfs_imap.c:889 jfs_evict_inode+0x32d/0x440 fs/jfs/inode.c:156 evict+0x2a8/0x630 fs/inode.c:669 __dentry_kill+0x20d/0x630 fs/dcache.c:610 shrink_kill+0xa9/0x2c0 fs/dcache.c:1055 shrink_dentry_list+0x2c0/0x5b0 fs/dcache.c:1082 prune_dcache_sb+0x10f/0x180 fs/dcache.c:1163 super_cache_scan+0x34f/0x4b0 fs/super.c:221 do_shrink_slab+0x701/0x1160 mm/shrinker.c:435 shrink_slab_memcg mm/shrinker.c:548 [inline] shrink_slab+0x878/0x14c0 mm/shrinker.c:626 shrink_node_memcgs mm/vmscan.c:5910 [inline] shrink_node+0x130f/0x2df0 mm/vmscan.c:5948 kswapd_shrink_node mm/vmscan.c:6762 [inline] balance_pgdat mm/vmscan.c:6954 [inline] kswapd+0x191b/0x2e80 mm/vmscan.c:7223 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