====================================================== WARNING: possible circular locking dependency detected 6.4.0-rc1-syzkaller #0 Not tainted ------------------------------------------------------ kworker/u4:2/41 is trying to acquire lock: ffff888073fe8940 (&rl->lock){++++}-{3:3}, at: ntfs_read_block fs/ntfs/aops.c:248 [inline] ffff888073fe8940 (&rl->lock){++++}-{3:3}, at: ntfs_read_folio+0x14d5/0x29f0 fs/ntfs/aops.c:436 but task is already holding lock: ffff888073feb310 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x4c/0x630 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}: lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5691 __mutex_lock_common+0x1d8/0x2530 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x1b/0x20 kernel/locking/mutex.c:799 map_mft_record+0x4c/0x630 fs/ntfs/mft.c:154 ntfs_truncate+0x267/0x2870 fs/ntfs/inode.c:2383 ntfs_truncate_vfs fs/ntfs/inode.c:2862 [inline] ntfs_setattr+0x2cb/0x3b0 fs/ntfs/inode.c:2914 notify_change+0xc8b/0xf40 fs/attr.c:483 do_truncate+0x220/0x300 fs/open.c:66 handle_truncate fs/namei.c:3295 [inline] do_open fs/namei.c:3640 [inline] path_openat+0x294e/0x3170 fs/namei.c:3791 do_filp_open+0x234/0x490 fs/namei.c:3818 do_sys_openat2+0x13f/0x500 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_creat fs/open.c:1448 [inline] __se_sys_creat fs/open.c:1442 [inline] __x64_sys_creat+0x123/0x160 fs/open.c:1442 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&rl->lock){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3108 [inline] check_prevs_add kernel/locking/lockdep.c:3227 [inline] validate_chain+0x166b/0x58e0 kernel/locking/lockdep.c:3842 __lock_acquire+0x1295/0x2000 kernel/locking/lockdep.c:5074 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5691 down_read+0x3d/0x50 kernel/locking/rwsem.c:1520 ntfs_read_block fs/ntfs/aops.c:248 [inline] ntfs_read_folio+0x14d5/0x29f0 fs/ntfs/aops.c:436 filemap_read_folio+0x19d/0x7a0 mm/filemap.c:2421 do_read_cache_folio+0x134/0x820 mm/filemap.c:3680 do_read_cache_page+0x32/0x220 mm/filemap.c:3746 read_mapping_page include/linux/pagemap.h:772 [inline] ntfs_map_page fs/ntfs/aops.h:75 [inline] ntfs_sync_mft_mirror+0x25f/0x1ae0 fs/ntfs/mft.c:480 write_mft_record_nolock+0x1155/0x18e0 fs/ntfs/mft.c:787 write_mft_record+0x149/0x310 fs/ntfs/mft.h:95 __ntfs_write_inode+0x703/0xbb0 fs/ntfs/inode.c:3050 write_inode fs/fs-writeback.c:1456 [inline] __writeback_single_inode+0x69b/0xfa0 fs/fs-writeback.c:1668 writeback_sb_inodes+0x8e3/0x11d0 fs/fs-writeback.c:1894 wb_writeback+0x458/0xc70 fs/fs-writeback.c:2068 wb_do_writeback fs/fs-writeback.c:2211 [inline] wb_workfn+0x400/0xff0 fs/fs-writeback.c:2251 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2405 worker_thread+0xa63/0x1210 kernel/workqueue.c:2552 kthread+0x2b8/0x350 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 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/41: #0: ffff88814513d938 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x77e/0x10e0 kernel/workqueue.c:2378 #1: ffffc90000b27d20 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x7c8/0x10e0 kernel/workqueue.c:2380 #2: ffff888073feb310 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x4c/0x630 fs/ntfs/mft.c:154 stack backtrace: CPU: 1 PID: 41 Comm: kworker/u4:2 Not tainted 6.4.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Workqueue: writeback wb_workfn (flush-7:4) Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2fe/0x3b0 kernel/locking/lockdep.c:2188 check_prev_add kernel/locking/lockdep.c:3108 [inline] check_prevs_add kernel/locking/lockdep.c:3227 [inline] validate_chain+0x166b/0x58e0 kernel/locking/lockdep.c:3842 __lock_acquire+0x1295/0x2000 kernel/locking/lockdep.c:5074 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5691 down_read+0x3d/0x50 kernel/locking/rwsem.c:1520 ntfs_read_block fs/ntfs/aops.c:248 [inline] ntfs_read_folio+0x14d5/0x29f0 fs/ntfs/aops.c:436 filemap_read_folio+0x19d/0x7a0 mm/filemap.c:2421 do_read_cache_folio+0x134/0x820 mm/filemap.c:3680 do_read_cache_page+0x32/0x220 mm/filemap.c:3746 read_mapping_page include/linux/pagemap.h:772 [inline] ntfs_map_page fs/ntfs/aops.h:75 [inline] ntfs_sync_mft_mirror+0x25f/0x1ae0 fs/ntfs/mft.c:480 write_mft_record_nolock+0x1155/0x18e0 fs/ntfs/mft.c:787 write_mft_record+0x149/0x310 fs/ntfs/mft.h:95 __ntfs_write_inode+0x703/0xbb0 fs/ntfs/inode.c:3050 write_inode fs/fs-writeback.c:1456 [inline] __writeback_single_inode+0x69b/0xfa0 fs/fs-writeback.c:1668 writeback_sb_inodes+0x8e3/0x11d0 fs/fs-writeback.c:1894 wb_writeback+0x458/0xc70 fs/fs-writeback.c:2068 wb_do_writeback fs/fs-writeback.c:2211 [inline] wb_workfn+0x400/0xff0 fs/fs-writeback.c:2251 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2405 worker_thread+0xa63/0x1210 kernel/workqueue.c:2552 kthread+0x2b8/0x350 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan0: Creating new IBSS network, BSSID 50:50:50:50:50:50