====================================================== WARNING: possible circular locking dependency detected 6.5.0-rc7-syzkaller-00108-g5c905279a1b7 #0 Not tainted ------------------------------------------------------ kswapd0/84 is trying to acquire lock: ffff888028724600 (sb_internal){.+.+}-{0:0}, at: evict+0x2ed/0x6b0 fs/inode.c:664 but task is already holding lock: ffffffff8cb0c860 (fs_reclaim){+.+.}-{0:0}, at: set_task_reclaim_state mm/vmscan.c:517 [inline] ffffffff8cb0c860 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x189/0x1b90 mm/vmscan.c:7391 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (fs_reclaim){+.+.}-{0:0}: __fs_reclaim_acquire mm/page_alloc.c:3602 [inline] fs_reclaim_acquire+0x11d/0x160 mm/page_alloc.c:3616 might_alloc include/linux/sched/mm.h:303 [inline] slab_pre_alloc_hook mm/slab.h:709 [inline] slab_alloc_node mm/slub.c:3452 [inline] slab_alloc mm/slub.c:3478 [inline] __kmem_cache_alloc_lru mm/slub.c:3485 [inline] kmem_cache_alloc+0x4f/0x3b0 mm/slub.c:3494 kmem_cache_zalloc include/linux/slab.h:693 [inline] __es_alloc_extent fs/ext4/extents_status.c:469 [inline] ext4_es_insert_delayed_block+0x41d/0x610 fs/ext4/extents_status.c:2044 ext4_insert_delayed_block fs/ext4/inode.c:1664 [inline] ext4_da_map_blocks fs/ext4/inode.c:1752 [inline] ext4_da_get_block_prep+0x850/0x1340 fs/ext4/inode.c:1813 ext4_block_write_begin+0x3da/0xe30 fs/ext4/inode.c:1043 ext4_da_write_begin+0x40a/0x8c0 fs/ext4/inode.c:2892 generic_perform_write+0x278/0x600 mm/filemap.c:3923 ext4_buffered_write_iter+0x11f/0x3c0 fs/ext4/file.c:299 ext4_file_write_iter+0x7ee/0x1950 fs/ext4/file.c:722 call_write_iter include/linux/fs.h:1877 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x650/0xe40 fs/read_write.c:584 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #2 (&ei->i_data_sem){++++}-{3:3}: down_write+0x93/0x200 kernel/locking/rwsem.c:1573 ext4_truncate+0xd2b/0x12f0 fs/ext4/inode.c:4122 ext4_setattr+0x1a40/0x29e0 fs/ext4/inode.c:5434 notify_change+0x670/0x1160 fs/attr.c:483 do_truncate+0x15c/0x220 fs/open.c:66 do_sys_ftruncate+0x6a2/0x790 fs/open.c:194 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #1 (jbd2_handle){++++}-{0:0}: start_this_handle+0x1116/0x1600 fs/jbd2/transaction.c:463 jbd2__journal_start+0x391/0x690 fs/jbd2/transaction.c:520 __ext4_journal_start_sb+0x40f/0x5c0 fs/ext4/ext4_jbd2.c:111 ext4_sample_last_mounted fs/ext4/file.c:863 [inline] ext4_file_open+0x632/0xc80 fs/ext4/file.c:892 do_dentry_open+0x88b/0x1780 fs/open.c:914 do_open fs/namei.c:3636 [inline] path_openat+0x19af/0x29c0 fs/namei.c:3793 do_filp_open+0x1de/0x430 fs/namei.c:3820 do_sys_openat2+0x176/0x1e0 fs/open.c:1407 do_sys_open fs/open.c:1422 [inline] __do_sys_openat fs/open.c:1438 [inline] __se_sys_openat fs/open.c:1433 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1433 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (sb_internal){.+.+}-{0:0}: check_prev_add kernel/locking/lockdep.c:3142 [inline] check_prevs_add kernel/locking/lockdep.c:3261 [inline] validate_chain kernel/locking/lockdep.c:3876 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5144 lock_acquire kernel/locking/lockdep.c:5761 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5726 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1494 [inline] sb_start_intwrite include/linux/fs.h:1616 [inline] ext4_evict_inode+0xe55/0x1a30 fs/ext4/inode.c:212 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1788 [inline] iput.part.0+0x55e/0x7a0 fs/inode.c:1814 iput+0x5c/0x80 fs/inode.c:1804 dentry_unlink_inode+0x292/0x430 fs/dcache.c:401 __dentry_kill+0x3b8/0x640 fs/dcache.c:607 shrink_dentry_list+0x235/0x7e0 fs/dcache.c:1201 prune_dcache_sb+0xeb/0x150 fs/dcache.c:1282 super_cache_scan+0x332/0x560 fs/super.c:104 do_shrink_slab+0x422/0xaa0 mm/vmscan.c:900 shrink_slab_memcg mm/vmscan.c:969 [inline] shrink_slab+0x48b/0x6e0 mm/vmscan.c:1048 shrink_one+0x4f7/0x700 mm/vmscan.c:5403 shrink_many mm/vmscan.c:5453 [inline] lru_gen_shrink_node mm/vmscan.c:5570 [inline] shrink_node+0x20c2/0x3730 mm/vmscan.c:6510 kswapd_shrink_node mm/vmscan.c:7315 [inline] balance_pgdat+0xa37/0x1b90 mm/vmscan.c:7505 kswapd+0x5be/0xbf0 mm/vmscan.c:7765 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 other info that might help us debug this: Chain exists of: sb_internal --> &ei->i_data_sem --> fs_reclaim Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(fs_reclaim); lock(&ei->i_data_sem); lock(fs_reclaim); rlock(sb_internal); *** DEADLOCK *** 3 locks held by kswapd0/84: #0: ffffffff8cb0c860 (fs_reclaim){+.+.}-{0:0}, at: set_task_reclaim_state mm/vmscan.c:517 [inline] #0: ffffffff8cb0c860 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x189/0x1b90 mm/vmscan.c:7391 #1: ffffffff8cabe390 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab_memcg mm/vmscan.c:942 [inline] #1: ffffffff8cabe390 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab+0x2b0/0x6e0 mm/vmscan.c:1048 #2: ffff8880287240e0 (&type->s_umount_key#31){++++}-{3:3}, at: trylock_super fs/super.c:413 [inline] #2: ffff8880287240e0 (&type->s_umount_key#31){++++}-{3:3}, at: super_cache_scan+0x74/0x560 fs/super.c:79 stack backtrace: CPU: 1 PID: 84 Comm: kswapd0 Not tainted 6.5.0-rc7-syzkaller-00108-g5c905279a1b7 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0x311/0x3f0 kernel/locking/lockdep.c:2195 check_prev_add kernel/locking/lockdep.c:3142 [inline] check_prevs_add kernel/locking/lockdep.c:3261 [inline] validate_chain kernel/locking/lockdep.c:3876 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5144 lock_acquire kernel/locking/lockdep.c:5761 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5726 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1494 [inline] sb_start_intwrite include/linux/fs.h:1616 [inline] ext4_evict_inode+0xe55/0x1a30 fs/ext4/inode.c:212 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1788 [inline] iput.part.0+0x55e/0x7a0 fs/inode.c:1814 iput+0x5c/0x80 fs/inode.c:1804 dentry_unlink_inode+0x292/0x430 fs/dcache.c:401 __dentry_kill+0x3b8/0x640 fs/dcache.c:607 shrink_dentry_list+0x235/0x7e0 fs/dcache.c:1201 prune_dcache_sb+0xeb/0x150 fs/dcache.c:1282 super_cache_scan+0x332/0x560 fs/super.c:104 do_shrink_slab+0x422/0xaa0 mm/vmscan.c:900 shrink_slab_memcg mm/vmscan.c:969 [inline] shrink_slab+0x48b/0x6e0 mm/vmscan.c:1048 shrink_one+0x4f7/0x700 mm/vmscan.c:5403 shrink_many mm/vmscan.c:5453 [inline] lru_gen_shrink_node mm/vmscan.c:5570 [inline] shrink_node+0x20c2/0x3730 mm/vmscan.c:6510 kswapd_shrink_node mm/vmscan.c:7315 [inline] balance_pgdat+0xa37/0x1b90 mm/vmscan.c:7505 kswapd+0x5be/0xbf0 mm/vmscan.c:7765 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304