====================================================== WARNING: possible circular locking dependency detected 6.7.0-rc2-syzkaller-00029-g9b6de136b5f0 #0 Not tainted ------------------------------------------------------ kworker/u4:6/956 is trying to acquire lock: ffff88806de3d1c0 (&rl->lock){++++}-{3:3}, at: ntfs_read_block fs/ntfs/aops.c:242 [inline] ffff88806de3d1c0 (&rl->lock){++++}-{3:3}, at: ntfs_read_folio+0x1a98/0x2430 fs/ntfs/aops.c:430 but task is already holding lock: ffff88806df70750 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x4a/0x730 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+0x175/0x9d0 kernel/locking/mutex.c:747 map_mft_record+0x4a/0x730 fs/ntfs/mft.c:154 ntfs_truncate+0x263/0x2a20 fs/ntfs/inode.c:2383 ntfs_truncate_vfs fs/ntfs/inode.c:2864 [inline] ntfs_setattr+0x44d/0x640 fs/ntfs/inode.c:2916 notify_change+0x742/0x11c0 fs/attr.c:499 do_truncate+0x15c/0x220 fs/open.c:66 handle_truncate fs/namei.c:3280 [inline] do_open fs/namei.c:3626 [inline] path_openat+0x25a0/0x2c50 fs/namei.c:3779 do_filp_open+0x1de/0x430 fs/namei.c:3809 do_sys_openat2+0x176/0x1e0 fs/open.c:1440 do_sys_open fs/open.c:1455 [inline] __do_sys_creat fs/open.c:1531 [inline] __se_sys_creat fs/open.c:1525 [inline] __x64_sys_creat+0xcd/0x120 fs/open.c:1525 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b -> #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:3868 [inline] __lock_acquire+0x2464/0x3b10 kernel/locking/lockdep.c:5136 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5718 down_read+0x9a/0x330 kernel/locking/rwsem.c:1526 ntfs_read_block fs/ntfs/aops.c:242 [inline] ntfs_read_folio+0x1a98/0x2430 fs/ntfs/aops.c:430 filemap_read_folio+0xe9/0x2c0 mm/filemap.c:2323 do_read_cache_folio+0x205/0x540 mm/filemap.c:3691 do_read_cache_page mm/filemap.c:3757 [inline] read_cache_page+0x5b/0x160 mm/filemap.c:3766 read_mapping_page include/linux/pagemap.h:854 [inline] ntfs_map_page fs/ntfs/aops.h:75 [inline] ntfs_sync_mft_mirror+0x242/0x1ed0 fs/ntfs/mft.c:480 write_mft_record_nolock+0x1977/0x1da0 fs/ntfs/mft.c:787 write_mft_record+0x14b/0x380 fs/ntfs/mft.h:95 __ntfs_write_inode+0x91b/0xc30 fs/ntfs/inode.c:3052 write_inode fs/fs-writeback.c:1473 [inline] __writeback_single_inode+0xa91/0xe90 fs/fs-writeback.c:1690 writeback_sb_inodes+0x599/0x1080 fs/fs-writeback.c:1916 __writeback_inodes_wb+0xff/0x2d0 fs/fs-writeback.c:1987 wb_writeback+0x7f8/0xaa0 fs/fs-writeback.c:2094 wb_check_background_flush fs/fs-writeback.c:2164 [inline] wb_do_writeback fs/fs-writeback.c:2252 [inline] wb_workfn+0x87c/0xfe0 fs/fs-writeback.c:2279 process_one_work+0x886/0x15d0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x2c6/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 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 *** 4 locks held by kworker/u4:6/956: #0: ffff888141e45138 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x789/0x15d0 kernel/workqueue.c:2605 #1: ffffc90003fa7d80 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x7eb/0x15d0 kernel/workqueue.c:2606 #2: ffff88807ea220e0 (&type->s_umount_key#66){++++}-{3:3}, at: super_trylock_shared+0x1e/0xf0 fs/super.c:610 #3: ffff88806df70750 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x4a/0x730 fs/ntfs/mft.c:154 stack backtrace: CPU: 0 PID: 956 Comm: kworker/u4:6 Not tainted 6.7.0-rc2-syzkaller-00029-g9b6de136b5f0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 Workqueue: writeback wb_workfn (flush-7:0) Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0x317/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:3868 [inline] __lock_acquire+0x2464/0x3b10 kernel/locking/lockdep.c:5136 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5718 down_read+0x9a/0x330 kernel/locking/rwsem.c:1526 ntfs_read_block fs/ntfs/aops.c:242 [inline] ntfs_read_folio+0x1a98/0x2430 fs/ntfs/aops.c:430 filemap_read_folio+0xe9/0x2c0 mm/filemap.c:2323 do_read_cache_folio+0x205/0x540 mm/filemap.c:3691 do_read_cache_page mm/filemap.c:3757 [inline] read_cache_page+0x5b/0x160 mm/filemap.c:3766 read_mapping_page include/linux/pagemap.h:854 [inline] ntfs_map_page fs/ntfs/aops.h:75 [inline] ntfs_sync_mft_mirror+0x242/0x1ed0 fs/ntfs/mft.c:480 write_mft_record_nolock+0x1977/0x1da0 fs/ntfs/mft.c:787 write_mft_record+0x14b/0x380 fs/ntfs/mft.h:95 __ntfs_write_inode+0x91b/0xc30 fs/ntfs/inode.c:3052 write_inode fs/fs-writeback.c:1473 [inline] __writeback_single_inode+0xa91/0xe90 fs/fs-writeback.c:1690 writeback_sb_inodes+0x599/0x1080 fs/fs-writeback.c:1916 __writeback_inodes_wb+0xff/0x2d0 fs/fs-writeback.c:1987 wb_writeback+0x7f8/0xaa0 fs/fs-writeback.c:2094 wb_check_background_flush fs/fs-writeback.c:2164 [inline] wb_do_writeback fs/fs-writeback.c:2252 [inline] wb_workfn+0x87c/0xfe0 fs/fs-writeback.c:2279 process_one_work+0x886/0x15d0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x2c6/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242