====================================================== WARNING: possible circular locking dependency detected 6.1.0-rc4-syzkaller-00045-g1767a722a708 #0 Not tainted ------------------------------------------------------ syz-executor.2/15196 is trying to acquire lock: ffff88803711bb50 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x3c/0x6b0 fs/ntfs/mft.c:154 but task is already holding lock: ffff88803711bac0 (&rl->lock){++++}-{3:3}, at: ntfs_truncate+0x1d2/0x2a50 fs/ntfs/inode.c:2378 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&rl->lock){++++}-{3:3}: down_read+0x98/0x450 kernel/locking/rwsem.c:1509 ntfs_read_block fs/ntfs/aops.c:248 [inline] ntfs_read_folio+0x1bd3/0x2e10 fs/ntfs/aops.c:436 filemap_read_folio+0xdb/0x2c0 mm/filemap.c:2407 do_read_cache_folio+0x1df/0x510 mm/filemap.c:3534 do_read_cache_page mm/filemap.c:3576 [inline] read_cache_page+0x59/0x170 mm/filemap.c:3585 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:3050 write_inode fs/fs-writeback.c:1440 [inline] __writeback_single_inode+0xcfc/0x1440 fs/fs-writeback.c:1652 writeback_sb_inodes+0x54d/0xf90 fs/fs-writeback.c:1870 wb_writeback+0x2c5/0xd70 fs/fs-writeback.c:2044 wb_do_writeback fs/fs-writeback.c:2187 [inline] wb_workfn+0x2dc/0x12f0 fs/fs-writeback.c:2227 process_one_work+0x9bf/0x1710 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 -> #0 (&ni->mrec_lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1df/0x630 kernel/locking/lockdep.c:5633 __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:2383 ntfs_truncate_vfs fs/ntfs/inode.c:2862 [inline] ntfs_setattr+0x393/0x560 fs/ntfs/inode.c:2914 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_sys_truncate fs/open.c:146 [inline] __se_sys_truncate fs/open.c:144 [inline] __x64_sys_truncate+0x69/0x90 fs/open.c:144 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&rl->lock); lock(&ni->mrec_lock); lock(&rl->lock); lock(&ni->mrec_lock); *** DEADLOCK *** 3 locks held by syz-executor.2/15196: #0: ffff88802d258460 (sb_writers#24){.+.+}-{0:0}, at: vfs_truncate+0xea/0x4c0 fs/open.c:84 #1: ffff88803711be30 (&sb->s_type->i_mutex_key#33){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] #1: ffff88803711be30 (&sb->s_type->i_mutex_key#33){+.+.}-{3:3}, at: do_truncate+0x12a/0x200 fs/open.c:63 #2: ffff88803711bac0 (&rl->lock){++++}-{3:3}, at: ntfs_truncate+0x1d2/0x2a50 fs/ntfs/inode.c:2378 stack backtrace: CPU: 0 PID: 15196 Comm: syz-executor.2 Not tainted 6.1.0-rc4-syzkaller-00045-g1767a722a708 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 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:2177 check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1df/0x630 kernel/locking/lockdep.c:5633 __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:2383 ntfs_truncate_vfs fs/ntfs/inode.c:2862 [inline] ntfs_setattr+0x393/0x560 fs/ntfs/inode.c:2914 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_sys_truncate fs/open.c:146 [inline] __se_sys_truncate fs/open.c:144 [inline] __x64_sys_truncate+0x69/0x90 fs/open.c:144 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f028528b639 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0285fab168 EFLAGS: 00000246 ORIG_RAX: 000000000000004c RAX: ffffffffffffffda RBX: 00007f02853ac050 RCX: 00007f028528b639 RDX: 0000000000000000 RSI: 0000000001100000 RDI: 00000000200020c0 RBP: 00007f02852e67e1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fffdc8f817f R14: 00007f0285fab300 R15: 0000000000022000 __ntfs_error: 5 callbacks suppressed ntfs: (device loop2): ntfs_cluster_alloc(): Failed to allocate clusters, aborting (error -28). ntfs: (device loop2): ntfs_attr_extend_allocation(): Cannot extend allocation of inode 0x44, attribute type 0x80, because the allocation of clusters failed with error code -28.