====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ kworker/u4:2/33 is trying to acquire lock: ffff88805ece8940 (&rl->lock){++++}-{3:3}, at: ntfs_read_block fs/ntfs/aops.c:248 [inline] ffff88805ece8940 (&rl->lock){++++}-{3:3}, at: ntfs_read_folio+0x145d/0x2990 fs/ntfs/aops.c:436 but task is already holding lock: ffff88805eceecd0 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x50/0x650 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}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x136/0xcc0 kernel/locking/mutex.c:747 map_mft_record+0x50/0x650 fs/ntfs/mft.c:154 ntfs_attr_extend_allocation+0x549/0x44a0 fs/ntfs/attrib.c:2002 ntfs_prepare_file_for_write fs/ntfs/file.c:391 [inline] ntfs_file_write_iter+0x33f/0x19c0 fs/ntfs/file.c:1914 call_write_iter include/linux/fs.h:2018 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x46c/0x990 fs/read_write.c:584 ksys_write+0x150/0x260 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&rl->lock){++++}-{3:3}: 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+0x2df1/0x7d40 kernel/locking/lockdep.c:5137 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754 down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520 ntfs_read_block fs/ntfs/aops.c:248 [inline] ntfs_read_folio+0x145d/0x2990 fs/ntfs/aops.c:436 filemap_read_folio+0x172/0x760 mm/filemap.c:2420 do_read_cache_folio+0x468/0x7d0 mm/filemap.c:3804 do_read_cache_page+0x32/0x250 mm/filemap.c:3870 read_mapping_page include/linux/pagemap.h:892 [inline] ntfs_map_page fs/ntfs/aops.h:75 [inline] ntfs_sync_mft_mirror+0x253/0x1ac0 fs/ntfs/mft.c:480 write_mft_record_nolock+0x118c/0x18f0 fs/ntfs/mft.c:787 write_mft_record+0x136/0x300 fs/ntfs/mft.h:95 __ntfs_write_inode+0x731/0xc00 fs/ntfs/inode.c:3051 write_inode fs/fs-writeback.c:1483 [inline] __writeback_single_inode+0x705/0xec0 fs/fs-writeback.c:1700 writeback_sb_inodes+0x7cd/0xf50 fs/fs-writeback.c:1926 wb_writeback+0x46a/0xbf0 fs/fs-writeback.c:2105 wb_do_writeback fs/fs-writeback.c:2252 [inline] wb_workfn+0x400/0xe60 fs/fs-writeback.c:2292 process_one_work kernel/workqueue.c:2634 [inline] process_scheduled_works+0xa5d/0x15d0 kernel/workqueue.c:2711 worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792 kthread+0x2fa/0x390 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293 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); rlock(&rl->lock); *** DEADLOCK *** 3 locks held by kworker/u4:2/33: #0: ffff888145644138 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2609 [inline] #0: ffff888145644138 ((wq_completion)writeback){+.+.}-{0:0}, at: process_scheduled_works+0x96f/0x15d0 kernel/workqueue.c:2711 #1: ffffc90000a9fd00 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2609 [inline] #1: ffffc90000a9fd00 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x96f/0x15d0 kernel/workqueue.c:2711 #2: ffff88805eceecd0 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x50/0x650 fs/ntfs/mft.c:154 stack backtrace: CPU: 0 PID: 33 Comm: kworker/u4:2 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025 Workqueue: writeback wb_workfn (flush-7:2) Call Trace: dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106 check_noncircular+0x2fc/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+0x2df1/0x7d40 kernel/locking/lockdep.c:5137 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754 down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520 ntfs_read_block fs/ntfs/aops.c:248 [inline] ntfs_read_folio+0x145d/0x2990 fs/ntfs/aops.c:436 filemap_read_folio+0x172/0x760 mm/filemap.c:2420 do_read_cache_folio+0x468/0x7d0 mm/filemap.c:3804 do_read_cache_page+0x32/0x250 mm/filemap.c:3870 read_mapping_page include/linux/pagemap.h:892 [inline] ntfs_map_page fs/ntfs/aops.h:75 [inline] ntfs_sync_mft_mirror+0x253/0x1ac0 fs/ntfs/mft.c:480 write_mft_record_nolock+0x118c/0x18f0 fs/ntfs/mft.c:787 write_mft_record+0x136/0x300 fs/ntfs/mft.h:95 __ntfs_write_inode+0x731/0xc00 fs/ntfs/inode.c:3051 write_inode fs/fs-writeback.c:1483 [inline] __writeback_single_inode+0x705/0xec0 fs/fs-writeback.c:1700 writeback_sb_inodes+0x7cd/0xf50 fs/fs-writeback.c:1926 wb_writeback+0x46a/0xbf0 fs/fs-writeback.c:2105 wb_do_writeback fs/fs-writeback.c:2252 [inline] wb_workfn+0x400/0xe60 fs/fs-writeback.c:2292 process_one_work kernel/workqueue.c:2634 [inline] process_scheduled_works+0xa5d/0x15d0 kernel/workqueue.c:2711 worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792 kthread+0x2fa/0x390 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293