====================================================== WARNING: possible circular locking dependency detected 6.1.0-syzkaller-11674-g84e57d292203 #0 Not tainted ------------------------------------------------------ kworker/u4:3/46 is trying to acquire lock: ffff88807518a200 (&rl->lock){++++}-{3:3}, at: ntfs_read_block+0x91a/0x22e0 fs/ntfs/aops.c:248 but task is already holding lock: ffff88805d3a9210 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x46/0x610 fs/ntfs/mft.c:154 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ni->mrec_lock){+.+.}-{3:3}: lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668 __mutex_lock_common+0x1bd/0x26e0 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799 map_mft_record+0x46/0x610 fs/ntfs/mft.c:154 ntfs_attr_extend_allocation+0x5b3/0x4580 fs/ntfs/attrib.c:2002 ntfs_prepare_file_for_write fs/ntfs/file.c:391 [inline] ntfs_file_write_iter+0x425/0x2d40 fs/ntfs/file.c:1915 call_write_iter include/linux/fs.h:2186 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x7dc/0xc50 fs/read_write.c:584 ksys_write+0x177/0x2a0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&rl->lock){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain+0x1898/0x6ae0 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668 down_read+0x39/0x50 kernel/locking/rwsem.c:1509 ntfs_read_block+0x91a/0x22e0 fs/ntfs/aops.c:248 filemap_read_folio+0x187/0x7d0 mm/filemap.c:2426 do_read_cache_folio+0x2d3/0x790 mm/filemap.c:3553 do_read_cache_page mm/filemap.c:3595 [inline] read_cache_page+0x56/0x270 mm/filemap.c:3604 read_mapping_page include/linux/pagemap.h:755 [inline] ntfs_map_page fs/ntfs/aops.h:75 [inline] ntfs_sync_mft_mirror+0x21a/0x1df0 fs/ntfs/mft.c:480 write_mft_record_nolock+0x1213/0x1930 fs/ntfs/mft.c:787 write_mft_record fs/ntfs/mft.h:95 [inline] __ntfs_write_inode+0x721/0xc90 fs/ntfs/inode.c:3050 write_inode fs/fs-writeback.c:1451 [inline] __writeback_single_inode+0x4d6/0x670 fs/fs-writeback.c:1663 writeback_sb_inodes+0x812/0x1050 fs/fs-writeback.c:1889 __writeback_inodes_wb+0x11d/0x260 fs/fs-writeback.c:1960 wb_writeback+0x440/0x7b0 fs/fs-writeback.c:2065 wb_check_start_all fs/fs-writeback.c:2187 [inline] wb_do_writeback fs/fs-writeback.c:2213 [inline] wb_workfn+0x827/0xef0 fs/fs-writeback.c:2246 process_one_work+0x877/0xdb0 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ni->mrec_lock); lock(&rl->lock); lock(&ni->mrec_lock); lock(&rl->lock); *** DEADLOCK *** 4 locks held by kworker/u4:3/46: #0: ffff8881451f4938 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x7f2/0xdb0 #1: ffffc90000b77d00 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x831/0xdb0 kernel/workqueue.c:2264 #2: ffff888071cd40e0 (&type->s_umount_key#47){++++}-{3:3}, at: trylock_super+0x1b/0xf0 fs/super.c:415 #3: ffff88805d3a9210 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x46/0x610 fs/ntfs/mft.c:154 stack backtrace: CPU: 0 PID: 46 Comm: kworker/u4:3 Not tainted 6.1.0-syzkaller-11674-g84e57d292203 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Workqueue: writeback wb_workfn (flush-7:0) Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1b1/0x290 lib/dump_stack.c:106 check_noncircular+0x2cc/0x390 kernel/locking/lockdep.c:2177 check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain+0x1898/0x6ae0 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668 down_read+0x39/0x50 kernel/locking/rwsem.c:1509 ntfs_read_block+0x91a/0x22e0 fs/ntfs/aops.c:248 filemap_read_folio+0x187/0x7d0 mm/filemap.c:2426 do_read_cache_folio+0x2d3/0x790 mm/filemap.c:3553 do_read_cache_page mm/filemap.c:3595 [inline] read_cache_page+0x56/0x270 mm/filemap.c:3604 read_mapping_page include/linux/pagemap.h:755 [inline] ntfs_map_page fs/ntfs/aops.h:75 [inline] ntfs_sync_mft_mirror+0x21a/0x1df0 fs/ntfs/mft.c:480 write_mft_record_nolock+0x1213/0x1930 fs/ntfs/mft.c:787 write_mft_record fs/ntfs/mft.h:95 [inline] __ntfs_write_inode+0x721/0xc90 fs/ntfs/inode.c:3050 write_inode fs/fs-writeback.c:1451 [inline] __writeback_single_inode+0x4d6/0x670 fs/fs-writeback.c:1663 writeback_sb_inodes+0x812/0x1050 fs/fs-writeback.c:1889 __writeback_inodes_wb+0x11d/0x260 fs/fs-writeback.c:1960 wb_writeback+0x440/0x7b0 fs/fs-writeback.c:2065 wb_check_start_all fs/fs-writeback.c:2187 [inline] wb_do_writeback fs/fs-writeback.c:2213 [inline] wb_workfn+0x827/0xef0 fs/fs-writeback.c:2246 process_one_work+0x877/0xdb0 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308