====================================================== WARNING: possible circular locking dependency detected 6.1.62-syzkaller #0 Not tainted ------------------------------------------------------ kworker/u4:0/9 is trying to acquire lock: ffff0000e2830940 (&rl->lock){++++}-{3:3}, at: ntfs_read_block fs/ntfs/aops.c:248 [inline] ffff0000e2830940 (&rl->lock){++++}-{3:3}, at: ntfs_read_folio+0xf40/0x1d70 fs/ntfs/aops.c:436 but task is already holding lock: ffff0000e2833310 (&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+0x38/0x44 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+0xb58/0xe1c fs/attr.c:499 do_truncate+0x1c0/0x28c fs/open.c:65 handle_truncate fs/namei.c:3217 [inline] do_open fs/namei.c:3562 [inline] path_openat+0x1fa0/0x2548 fs/namei.c:3715 do_filp_open+0x1bc/0x3cc fs/namei.c:3742 do_sys_openat2+0x128/0x3d8 fs/open.c:1318 do_sys_open fs/open.c:1334 [inline] __do_sys_openat fs/open.c:1350 [inline] __se_sys_openat fs/open.c:1345 [inline] __arm64_sys_openat+0x1f0/0x240 fs/open.c:1345 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #0 (&rl->lock){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3824 [inline] __lock_acquire+0x3338/0x764c kernel/locking/lockdep.c:5048 lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5661 down_read+0x64/0x308 kernel/locking/rwsem.c:1520 ntfs_read_block fs/ntfs/aops.c:248 [inline] ntfs_read_folio+0xf40/0x1d70 fs/ntfs/aops.c:436 filemap_read_folio+0x14c/0x39c mm/filemap.c:2407 do_read_cache_folio+0x24c/0x544 mm/filemap.c:3535 do_read_cache_page mm/filemap.c:3577 [inline] read_cache_page+0x6c/0x180 mm/filemap.c:3586 read_mapping_page include/linux/pagemap.h:756 [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:2656 write_inode fs/fs-writeback.c:1443 [inline] __writeback_single_inode+0x614/0x1770 fs/fs-writeback.c:1660 writeback_sb_inodes+0x978/0x1718 fs/fs-writeback.c:1886 wb_writeback+0x414/0x1130 fs/fs-writeback.c:2060 wb_do_writeback fs/fs-writeback.c:2203 [inline] wb_workfn+0x3a8/0x1034 fs/fs-writeback.c:2243 process_one_work+0x7ac/0x1404 kernel/workqueue.c:2292 worker_thread+0x8e4/0xfec kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:864 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/u4:0/9: #0: ffff0000c2e3d938 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x664/0x1404 kernel/workqueue.c:2265 #1: ffff800019de7c20 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x6a8/0x1404 kernel/workqueue.c:2267 #2: ffff0000e2833310 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x64/0x7b4 fs/ntfs/mft.c:154 stack backtrace: CPU: 0 PID: 9 Comm: kworker/u4:0 Not tainted 6.1.62-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Workqueue: writeback wb_workfn (flush-7:0) Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2048 check_noncircular+0x2cc/0x378 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3824 [inline] __lock_acquire+0x3338/0x764c kernel/locking/lockdep.c:5048 lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5661 down_read+0x64/0x308 kernel/locking/rwsem.c:1520 ntfs_read_block fs/ntfs/aops.c:248 [inline] ntfs_read_folio+0xf40/0x1d70 fs/ntfs/aops.c:436 filemap_read_folio+0x14c/0x39c mm/filemap.c:2407 do_read_cache_folio+0x24c/0x544 mm/filemap.c:3535 do_read_cache_page mm/filemap.c:3577 [inline] read_cache_page+0x6c/0x180 mm/filemap.c:3586 read_mapping_page include/linux/pagemap.h:756 [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:2656 write_inode fs/fs-writeback.c:1443 [inline] __writeback_single_inode+0x614/0x1770 fs/fs-writeback.c:1660 writeback_sb_inodes+0x978/0x1718 fs/fs-writeback.c:1886 wb_writeback+0x414/0x1130 fs/fs-writeback.c:2060 wb_do_writeback fs/fs-writeback.c:2203 [inline] wb_workfn+0x3a8/0x1034 fs/fs-writeback.c:2243 process_one_work+0x7ac/0x1404 kernel/workqueue.c:2292 worker_thread+0x8e4/0xfec kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:864