====================================================== WARNING: possible circular locking dependency detected 6.0.0-rc7-syzkaller-00034-ga1375562c0a8 #0 Not tainted ------------------------------------------------------ kworker/u17:4/74 is trying to acquire lock: ffff88804540aa40 (&rl->lock){++++}-{3:3}, at: ntfs_read_block fs/ntfs/aops.c:248 [inline] ffff88804540aa40 (&rl->lock){++++}-{3:3}, at: ntfs_read_folio+0x1bd3/0x2e10 fs/ntfs/aops.c:436 but task is already holding lock: ffff888079d43310 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x3c/0x6b0 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+0x12f/0x1350 kernel/locking/mutex.c:747 map_mft_record+0x3c/0x6b0 fs/ntfs/mft.c:154 ntfs_truncate+0x23f/0x2a50 fs/ntfs/inode.c:2376 ntfs_truncate_vfs fs/ntfs/inode.c:2855 [inline] ntfs_setattr+0x393/0x560 fs/ntfs/inode.c:2907 notify_change+0xcd0/0x1440 fs/attr.c:420 do_truncate+0x13c/0x200 fs/open.c:65 vfs_truncate+0x3db/0x4c0 fs/open.c:111 do_sys_truncate.part.0+0x11e/0x140 fs/open.c:134 do_sys_truncate fs/open.c:128 [inline] __do_compat_sys_truncate fs/open.c:152 [inline] __se_compat_sys_truncate fs/open.c:150 [inline] __ia32_compat_sys_truncate+0x6c/0xa0 fs/open.c:150 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 -> #0 (&rl->lock){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5666 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631 down_read+0x98/0x450 kernel/locking/rwsem.c:1499 ntfs_read_block fs/ntfs/aops.c:248 [inline] ntfs_read_folio+0x1bd3/0x2e10 fs/ntfs/aops.c:436 filemap_read_folio+0x3c/0x1d0 mm/filemap.c:2394 do_read_cache_folio+0x1df/0x510 mm/filemap.c:3519 do_read_cache_page mm/filemap.c:3561 [inline] read_cache_page+0x59/0x2b0 mm/filemap.c:3570 read_mapping_page include/linux/pagemap.h:756 [inline] ntfs_map_page fs/ntfs/aops.h:75 [inline] ntfs_sync_mft_mirror+0x24b/0x1ea0 fs/ntfs/mft.c:480 write_mft_record_nolock+0x198a/0x1cc0 fs/ntfs/mft.c:787 write_mft_record+0x14e/0x3b0 fs/ntfs/mft.h:95 __ntfs_write_inode+0x911/0xc40 fs/ntfs/inode.c:3043 write_inode fs/fs-writeback.c:1440 [inline] __writeback_single_inode+0xb5c/0x10b0 fs/fs-writeback.c:1652 writeback_sb_inodes+0x54d/0xf10 fs/fs-writeback.c:1865 wb_writeback+0x294/0xc20 fs/fs-writeback.c:2039 wb_do_writeback fs/fs-writeback.c:2182 [inline] wb_workfn+0x2a1/0x1170 fs/fs-writeback.c:2222 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 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 *** 3 locks held by kworker/u17:4/74: #0: ffff88801532f138 ((wq_completion)writeback){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff88801532f138 ((wq_completion)writeback){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline] #0: ffff88801532f138 ((wq_completion)writeback){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline] #0: ffff88801532f138 ((wq_completion)writeback){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline] #0: ffff88801532f138 ((wq_completion)writeback){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline] #0: ffff88801532f138 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260 #1: ffffc90000ce7da8 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264 #2: ffff888079d43310 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x3c/0x6b0 fs/ntfs/mft.c:154 stack backtrace: CPU: 2 PID: 74 Comm: kworker/u17:4 Not tainted 6.0.0-rc7-syzkaller-00034-ga1375562c0a8 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Workqueue: writeback wb_workfn (flush-7:2) Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5666 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631 down_read+0x98/0x450 kernel/locking/rwsem.c:1499 ntfs_read_block fs/ntfs/aops.c:248 [inline] ntfs_read_folio+0x1bd3/0x2e10 fs/ntfs/aops.c:436 filemap_read_folio+0x3c/0x1d0 mm/filemap.c:2394 do_read_cache_folio+0x1df/0x510 mm/filemap.c:3519 do_read_cache_page mm/filemap.c:3561 [inline] read_cache_page+0x59/0x2b0 mm/filemap.c:3570 read_mapping_page include/linux/pagemap.h:756 [inline] ntfs_map_page fs/ntfs/aops.h:75 [inline] ntfs_sync_mft_mirror+0x24b/0x1ea0 fs/ntfs/mft.c:480 write_mft_record_nolock+0x198a/0x1cc0 fs/ntfs/mft.c:787 write_mft_record+0x14e/0x3b0 fs/ntfs/mft.h:95 __ntfs_write_inode+0x911/0xc40 fs/ntfs/inode.c:3043 write_inode fs/fs-writeback.c:1440 [inline] __writeback_single_inode+0xb5c/0x10b0 fs/fs-writeback.c:1652 writeback_sb_inodes+0x54d/0xf10 fs/fs-writeback.c:1865 wb_writeback+0x294/0xc20 fs/fs-writeback.c:2039 wb_do_writeback fs/fs-writeback.c:2182 [inline] wb_workfn+0x2a1/0x1170 fs/fs-writeback.c:2222 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306