====================================================== WARNING: possible circular locking dependency detected 6.9.0-syzkaller-01893-g6bfd2d442af5 #0 Not tainted ------------------------------------------------------ kswapd0/111 is trying to acquire lock: ffff888024a8a950 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x10db/0x15e0 fs/jbd2/transaction.c:463 but task is already holding lock: ffffffff8db322e0 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x166/0x19a0 mm/vmscan.c:6782 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (fs_reclaim){+.+.}-{0:0}: __fs_reclaim_acquire mm/page_alloc.c:3698 [inline] fs_reclaim_acquire+0x102/0x160 mm/page_alloc.c:3712 might_alloc include/linux/sched/mm.h:312 [inline] prepare_alloc_pages.constprop.0+0x155/0x560 mm/page_alloc.c:4346 __alloc_pages+0x194/0x2460 mm/page_alloc.c:4564 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] __kmalloc_large_node+0x7f/0x1a0 mm/slub.c:3984 __do_kmalloc_node mm/slub.c:4027 [inline] __kmalloc_node.cold+0x5/0x5f mm/slub.c:4046 kmalloc_node include/linux/slab.h:648 [inline] kvmalloc_node+0x6f/0x1a0 mm/util.c:634 kvmalloc include/linux/slab.h:766 [inline] ext4_xattr_inode_cache_find fs/ext4/xattr.c:1535 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1581 [inline] ext4_xattr_set_entry+0xecd/0x3c70 fs/ext4/xattr.c:1718 ext4_xattr_block_set+0xcc3/0x3100 fs/ext4/xattr.c:2037 ext4_xattr_move_to_block fs/ext4/xattr.c:2654 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2729 [inline] ext4_expand_extra_isize_ea+0x1484/0x1ae0 fs/ext4/xattr.c:2821 __ext4_expand_extra_isize+0x346/0x480 fs/ext4/inode.c:5789 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5832 [inline] __ext4_mark_inode_dirty+0x55a/0x890 fs/ext4/inode.c:5910 ext4_try_add_inline_entry+0x24b/0x650 fs/ext4/inline.c:1317 ext4_add_entry+0x7e1/0xdf0 fs/ext4/namei.c:2405 ext4_add_nondir+0x91/0x2b0 fs/ext4/namei.c:2792 ext4_create+0x3a4/0x550 fs/ext4/namei.c:2838 lookup_open.isra.0+0x10a1/0x13c0 fs/namei.c:3505 open_last_lookups fs/namei.c:3574 [inline] path_openat+0x92f/0x2990 fs/namei.c:3804 do_filp_open+0x1dc/0x430 fs/namei.c:3834 do_sys_openat2+0x17a/0x1e0 fs/open.c:1406 do_sys_open fs/open.c:1421 [inline] __do_sys_openat fs/open.c:1437 [inline] __se_sys_openat fs/open.c:1432 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1432 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&ei->xattr_sem){++++}-{3:3}: down_write+0x3a/0x50 kernel/locking/rwsem.c:1579 ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline] ext4_xattr_set_handle+0x159/0x1420 fs/ext4/xattr.c:2358 ext4_initxattrs+0xbc/0x120 fs/ext4/xattr_security.c:44 security_inode_init_security+0x21c/0x380 security/security.c:1744 __ext4_new_inode+0x425b/0x51e0 fs/ext4/ialloc.c:1326 ext4_create+0x304/0x550 fs/ext4/namei.c:2830 lookup_open.isra.0+0x10a1/0x13c0 fs/namei.c:3505 open_last_lookups fs/namei.c:3574 [inline] path_openat+0x92f/0x2990 fs/namei.c:3804 do_filp_open+0x1dc/0x430 fs/namei.c:3834 do_sys_openat2+0x17a/0x1e0 fs/open.c:1406 do_sys_open fs/open.c:1421 [inline] __do_sys_openat fs/open.c:1437 [inline] __se_sys_openat fs/open.c:1432 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1432 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (jbd2_handle){++++}-{0:0}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 start_this_handle+0x1101/0x15e0 fs/jbd2/transaction.c:463 jbd2__journal_start+0x394/0x6a0 fs/jbd2/transaction.c:520 __ext4_journal_start_sb+0x358/0x660 fs/ext4/ext4_jbd2.c:112 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline] ext4_dirty_inode+0xa1/0x130 fs/ext4/inode.c:5939 __mark_inode_dirty+0x1f0/0xe70 fs/fs-writeback.c:2486 mark_inode_dirty_sync include/linux/fs.h:2426 [inline] iput.part.0+0x5b/0x7f0 fs/inode.c:1764 iput+0x5c/0x80 fs/inode.c:1757 dentry_unlink_inode+0x295/0x440 fs/dcache.c:400 __dentry_kill+0x1d0/0x600 fs/dcache.c:603 shrink_kill fs/dcache.c:1048 [inline] shrink_dentry_list+0x140/0x5d0 fs/dcache.c:1075 prune_dcache_sb+0xeb/0x150 fs/dcache.c:1156 super_cache_scan+0x32a/0x550 fs/super.c:221 do_shrink_slab+0x44f/0x11c0 mm/shrinker.c:435 shrink_slab_memcg mm/shrinker.c:548 [inline] shrink_slab+0xa87/0x1310 mm/shrinker.c:626 shrink_one+0x493/0x7c0 mm/vmscan.c:4774 shrink_many mm/vmscan.c:4835 [inline] lru_gen_shrink_node mm/vmscan.c:4935 [inline] shrink_node+0x231f/0x3a80 mm/vmscan.c:5894 kswapd_shrink_node mm/vmscan.c:6704 [inline] balance_pgdat+0x9a0/0x19a0 mm/vmscan.c:6895 kswapd+0x5ea/0xbf0 mm/vmscan.c:7164 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/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: jbd2_handle --> &ei->xattr_sem --> fs_reclaim Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(fs_reclaim); lock(&ei->xattr_sem); lock(fs_reclaim); rlock(jbd2_handle); *** DEADLOCK *** 2 locks held by kswapd0/111: #0: ffffffff8db322e0 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x166/0x19a0 mm/vmscan.c:6782 #1: ffff888024aac0e0 (&type->s_umount_key#52){++++}-{3:3}, at: super_trylock_shared fs/super.c:561 [inline] #1: ffff888024aac0e0 (&type->s_umount_key#52){++++}-{3:3}, at: super_cache_scan+0x96/0x550 fs/super.c:196 stack backtrace: CPU: 3 PID: 111 Comm: kswapd0 Not tainted 6.9.0-syzkaller-01893-g6bfd2d442af5 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 check_noncircular+0x31a/0x400 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 kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 start_this_handle+0x1101/0x15e0 fs/jbd2/transaction.c:463 jbd2__journal_start+0x394/0x6a0 fs/jbd2/transaction.c:520 __ext4_journal_start_sb+0x358/0x660 fs/ext4/ext4_jbd2.c:112 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline] ext4_dirty_inode+0xa1/0x130 fs/ext4/inode.c:5939 __mark_inode_dirty+0x1f0/0xe70 fs/fs-writeback.c:2486 mark_inode_dirty_sync include/linux/fs.h:2426 [inline] iput.part.0+0x5b/0x7f0 fs/inode.c:1764 iput+0x5c/0x80 fs/inode.c:1757 dentry_unlink_inode+0x295/0x440 fs/dcache.c:400 __dentry_kill+0x1d0/0x600 fs/dcache.c:603 shrink_kill fs/dcache.c:1048 [inline] shrink_dentry_list+0x140/0x5d0 fs/dcache.c:1075 prune_dcache_sb+0xeb/0x150 fs/dcache.c:1156 super_cache_scan+0x32a/0x550 fs/super.c:221 do_shrink_slab+0x44f/0x11c0 mm/shrinker.c:435 shrink_slab_memcg mm/shrinker.c:548 [inline] shrink_slab+0xa87/0x1310 mm/shrinker.c:626 shrink_one+0x493/0x7c0 mm/vmscan.c:4774 shrink_many mm/vmscan.c:4835 [inline] lru_gen_shrink_node mm/vmscan.c:4935 [inline] shrink_node+0x231f/0x3a80 mm/vmscan.c:5894 kswapd_shrink_node mm/vmscan.c:6704 [inline] balance_pgdat+0x9a0/0x19a0 mm/vmscan.c:6895 kswapd+0x5ea/0xbf0 mm/vmscan.c:7164 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244