====================================================== WARNING: possible circular locking dependency detected 6.9.0-syzkaller-10729-gb6394d6f7159 #0 Not tainted ------------------------------------------------------ kswapd0/90 is trying to acquire lock: ffff88807e3c8128 (&wnd->rw_lock/1){+.+.}-{3:3}, at: ntfs_mark_rec_free+0x3f/0x2b0 fs/ntfs3/fsntfs.c:742 but task is already holding lock: ffffffff8e429680 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat mm/vmscan.c:6798 [inline] ffffffff8e429680 (fs_reclaim){+.+.}-{0:0}, at: kswapd+0xb1e/0x2f30 mm/vmscan.c:7180 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:5754 __fs_reclaim_acquire mm/page_alloc.c:3783 [inline] fs_reclaim_acquire+0x88/0x140 mm/page_alloc.c:3797 might_alloc include/linux/sched/mm.h:334 [inline] slab_pre_alloc_hook mm/slub.c:3890 [inline] slab_alloc_node mm/slub.c:3980 [inline] __do_kmalloc_node mm/slub.c:4120 [inline] __kmalloc_node_noprof+0xb5/0x450 mm/slub.c:4128 kmalloc_node_noprof include/linux/slab.h:681 [inline] kvmalloc_node_noprof+0x72/0x190 mm/util.c:634 run_add_entry+0x9ea/0xe80 fs/ntfs3/run.c:389 attr_allocate_clusters+0x3ab/0x990 fs/ntfs3/attrib.c:181 attr_set_size+0x2049/0x4290 fs/ntfs3/attrib.c:572 ntfs_set_size+0x161/0x200 fs/ntfs3/inode.c:845 ntfs_extend+0x16d/0x4a0 fs/ntfs3/file.c:335 ntfs_file_write_iter+0x3ea/0x770 fs/ntfs3/file.c:1115 new_sync_write fs/read_write.c:497 [inline] vfs_write+0xa72/0xc90 fs/read_write.c:590 ksys_write+0x1a0/0x2c0 fs/read_write.c:643 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 -> #1 (&ni->file.run_lock#2){++++}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 down_read+0xb1/0xa40 kernel/locking/rwsem.c:1526 mi_read+0x181/0x5a0 fs/ntfs3/record.c:129 mi_format_new+0x1ab/0x5d0 fs/ntfs3/record.c:420 ni_add_subrecord+0xe2/0x430 fs/ntfs3/frecord.c:372 ntfs_look_free_mft+0x878/0x10c0 fs/ntfs3/fsntfs.c:715 ni_create_attr_list+0x9bd/0x1480 fs/ntfs3/frecord.c:876 ni_ins_attr_ext+0x369/0xbe0 fs/ntfs3/frecord.c:974 ni_insert_attr fs/ntfs3/frecord.c:1141 [inline] ni_insert_resident fs/ntfs3/frecord.c:1525 [inline] ni_add_name+0x809/0xe90 fs/ntfs3/frecord.c:3047 ni_rename+0xc2/0x1e0 fs/ntfs3/frecord.c:3087 ntfs_rename+0x7c1/0xd10 fs/ntfs3/namei.c:334 vfs_rename+0xbdb/0xf00 fs/namei.c:4887 do_renameat2+0xd94/0x13f0 fs/namei.c:5044 __do_sys_rename fs/namei.c:5091 [inline] __se_sys_rename fs/namei.c:5089 [inline] __x64_sys_rename+0x86/0xa0 fs/namei.c:5089 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 (&wnd->rw_lock/1){+.+.}-{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_write_nested+0x3d/0x50 kernel/locking/rwsem.c:1695 ntfs_mark_rec_free+0x3f/0x2b0 fs/ntfs3/fsntfs.c:742 ni_delete_all+0x8ad/0x990 fs/ntfs3/frecord.c:1637 ni_clear+0x372/0x3f0 fs/ntfs3/frecord.c:106 evict+0x2a8/0x630 fs/inode.c:667 __dentry_kill+0x20d/0x630 fs/dcache.c:603 shrink_kill+0xa9/0x2c0 fs/dcache.c:1048 shrink_dentry_list+0x2c0/0x5b0 fs/dcache.c:1075 prune_dcache_sb+0x10f/0x180 fs/dcache.c:1156 super_cache_scan+0x34f/0x4b0 fs/super.c:221 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:5891 [inline] shrink_node+0x10ec/0x2a30 mm/vmscan.c:5924 kswapd_shrink_node mm/vmscan.c:6720 [inline] balance_pgdat mm/vmscan.c:6911 [inline] kswapd+0x19a4/0x2f30 mm/vmscan.c:7180 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: &wnd->rw_lock/1 --> &ni->file.run_lock#2 --> fs_reclaim Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(fs_reclaim); lock(&ni->file.run_lock#2); lock(fs_reclaim); lock(&wnd->rw_lock/1); *** DEADLOCK *** 2 locks held by kswapd0/90: #0: ffffffff8e429680 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat mm/vmscan.c:6798 [inline] #0: ffffffff8e429680 (fs_reclaim){+.+.}-{0:0}, at: kswapd+0xb1e/0x2f30 mm/vmscan.c:7180 #1: ffff88802317c0e0 (&type->s_umount_key#61){++++}-{3:3}, at: super_trylock_shared fs/super.c:562 [inline] #1: ffff88802317c0e0 (&type->s_umount_key#61){++++}-{3:3}, at: super_cache_scan+0x94/0x4b0 fs/super.c:196 stack backtrace: CPU: 0 PID: 90 Comm: kswapd0 Not tainted 6.9.0-syzkaller-10729-gb6394d6f7159 #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_write_nested+0x3d/0x50 kernel/locking/rwsem.c:1695 ntfs_mark_rec_free+0x3f/0x2b0 fs/ntfs3/fsntfs.c:742 ni_delete_all+0x8ad/0x990 fs/ntfs3/frecord.c:1637 ni_clear+0x372/0x3f0 fs/ntfs3/frecord.c:106 evict+0x2a8/0x630 fs/inode.c:667 __dentry_kill+0x20d/0x630 fs/dcache.c:603 shrink_kill+0xa9/0x2c0 fs/dcache.c:1048 shrink_dentry_list+0x2c0/0x5b0 fs/dcache.c:1075 prune_dcache_sb+0x10f/0x180 fs/dcache.c:1156 super_cache_scan+0x34f/0x4b0 fs/super.c:221 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:5891 [inline] shrink_node+0x10ec/0x2a30 mm/vmscan.c:5924 kswapd_shrink_node mm/vmscan.c:6720 [inline] balance_pgdat mm/vmscan.c:6911 [inline] kswapd+0x19a4/0x2f30 mm/vmscan.c:7180 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