====================================================== WARNING: possible circular locking dependency detected 6.5.0-rc7-syzkaller-gfe4469582053 #0 Not tainted ------------------------------------------------------ kworker/u4:2/39 is trying to acquire lock: ffff0000e0070940 (&rl->lock){++++}-{3:3}, at: ntfs_read_block fs/ntfs/aops.c:248 [inline] ffff0000e0070940 (&rl->lock){++++}-{3:3}, at: ntfs_read_folio+0xf70/0x200c fs/ntfs/aops.c:436 but task is already holding lock: ffff0000e0073310 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x64/0x7b4 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+0x190/0x21a0 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799 map_mft_record+0x64/0x7b4 fs/ntfs/mft.c:154 ntfs_truncate+0x1d4/0x2118 fs/ntfs/inode.c:2383 ntfs_truncate_vfs fs/ntfs/inode.c:2862 [inline] ntfs_setattr+0x260/0x320 fs/ntfs/inode.c:2914 notify_change+0xa84/0xd20 fs/attr.c:483 do_truncate+0x1c0/0x28c fs/open.c:66 handle_truncate fs/namei.c:3295 [inline] do_open fs/namei.c:3640 [inline] path_openat+0x2130/0x27f8 fs/namei.c:3793 do_filp_open+0x1bc/0x3cc fs/namei.c:3820 do_sys_openat2+0x124/0x1b8 fs/open.c:1407 do_sys_open fs/open.c:1422 [inline] __do_sys_openat fs/open.c:1438 [inline] __se_sys_openat fs/open.c:1433 [inline] __arm64_sys_openat+0x1f0/0x240 fs/open.c:1433 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 -> #0 (&rl->lock){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3142 [inline] check_prevs_add kernel/locking/lockdep.c:3261 [inline] validate_chain kernel/locking/lockdep.c:3876 [inline] __lock_acquire+0x3370/0x75e8 kernel/locking/lockdep.c:5144 lock_acquire+0x23c/0x71c kernel/locking/lockdep.c:5761 down_read+0x58/0x2fc kernel/locking/rwsem.c:1520 ntfs_read_block fs/ntfs/aops.c:248 [inline] ntfs_read_folio+0xf70/0x200c fs/ntfs/aops.c:436 filemap_read_folio+0x14c/0x39c mm/filemap.c:2389 do_read_cache_folio+0x114/0x548 mm/filemap.c:3696 do_read_cache_page mm/filemap.c:3762 [inline] read_cache_page+0x6c/0x170 mm/filemap.c:3771 read_mapping_page include/linux/pagemap.h:776 [inline] ntfs_map_page fs/ntfs/aops.h:75 [inline] ntfs_sync_mft_mirror+0x1cc/0x1890 fs/ntfs/mft.c:480 write_mft_record_nolock+0x100c/0x1630 fs/ntfs/mft.c:787 write_mft_record+0x144/0x1bc fs/ntfs/mft.h:95 __ntfs_write_inode+0x5cc/0xa78 fs/ntfs/inode.c:3050 ntfs_write_inode+0x68/0x90 fs/ntfs/super.c:2664 write_inode fs/fs-writeback.c:1456 [inline] __writeback_single_inode+0x5a8/0x146c fs/fs-writeback.c:1668 writeback_sb_inodes+0x720/0xff0 fs/fs-writeback.c:1894 wb_writeback+0x3f4/0xfc0 fs/fs-writeback.c:2070 wb_do_writeback fs/fs-writeback.c:2217 [inline] wb_workfn+0x37c/0xf9c fs/fs-writeback.c:2257 process_one_work+0x800/0x1480 kernel/workqueue.c:2600 worker_thread+0x8e0/0xfe8 kernel/workqueue.c:2751 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:853 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/39: #0: ffff0000c1e1e938 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x6b4/0x1480 kernel/workqueue.c:2572 #1: ffff800092f67c20 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x6f0/0x1480 kernel/workqueue.c:2574 #2: ffff0000e0073310 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x64/0x7b4 fs/ntfs/mft.c:154 stack backtrace: CPU: 1 PID: 39 Comm: kworker/u4:2 Not tainted 6.5.0-rc7-syzkaller-gfe4469582053 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023 Workqueue: writeback wb_workfn (flush-7:0) Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:233 show_stack+0x2c/0x44 arch/arm64/kernel/stacktrace.c:240 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106 dump_stack+0x1c/0x28 lib/dump_stack.c:113 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2068 check_noncircular+0x310/0x404 kernel/locking/lockdep.c:2195 check_prev_add kernel/locking/lockdep.c:3142 [inline] check_prevs_add kernel/locking/lockdep.c:3261 [inline] validate_chain kernel/locking/lockdep.c:3876 [inline] __lock_acquire+0x3370/0x75e8 kernel/locking/lockdep.c:5144 lock_acquire+0x23c/0x71c kernel/locking/lockdep.c:5761 down_read+0x58/0x2fc kernel/locking/rwsem.c:1520 ntfs_read_block fs/ntfs/aops.c:248 [inline] ntfs_read_folio+0xf70/0x200c fs/ntfs/aops.c:436 filemap_read_folio+0x14c/0x39c mm/filemap.c:2389 do_read_cache_folio+0x114/0x548 mm/filemap.c:3696 do_read_cache_page mm/filemap.c:3762 [inline] read_cache_page+0x6c/0x170 mm/filemap.c:3771 read_mapping_page include/linux/pagemap.h:776 [inline] ntfs_map_page fs/ntfs/aops.h:75 [inline] ntfs_sync_mft_mirror+0x1cc/0x1890 fs/ntfs/mft.c:480 write_mft_record_nolock+0x100c/0x1630 fs/ntfs/mft.c:787 write_mft_record+0x144/0x1bc fs/ntfs/mft.h:95 __ntfs_write_inode+0x5cc/0xa78 fs/ntfs/inode.c:3050 ntfs_write_inode+0x68/0x90 fs/ntfs/super.c:2664 write_inode fs/fs-writeback.c:1456 [inline] __writeback_single_inode+0x5a8/0x146c fs/fs-writeback.c:1668 writeback_sb_inodes+0x720/0xff0 fs/fs-writeback.c:1894 wb_writeback+0x3f4/0xfc0 fs/fs-writeback.c:2070 wb_do_writeback fs/fs-writeback.c:2217 [inline] wb_workfn+0x37c/0xf9c fs/fs-writeback.c:2257 process_one_work+0x800/0x1480 kernel/workqueue.c:2600 worker_thread+0x8e0/0xfe8 kernel/workqueue.c:2751 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:853