ntfs: (device loop2): ntfs_read_locked_inode(): Failed with error code -2. Marking corrupt inode 0xa as bad. Run chkdsk. ntfs: (device loop2): load_and_init_upcase(): Failed to load $UpCase from the volume. Using default. ntfs: volume version 3.1. ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.2.1191/9423 is trying to acquire lock: ffff888059010190 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x50/0x650 fs/ntfs/mft.c:154 but task is already holding lock: ffff888059010100 (&rl->lock){++++}-{3:3}, at: ntfs_attr_extend_allocation+0x505/0x43e0 fs/ntfs/attrib.c:2001 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&rl->lock){++++}-{3:3}: down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520 ntfs_read_block fs/ntfs/aops.c:248 [inline] ntfs_read_folio+0x1433/0x2960 fs/ntfs/aops.c:436 filemap_read_folio+0x16b/0x790 mm/filemap.c:2420 do_read_cache_folio+0x485/0x7f0 mm/filemap.c:3809 do_read_cache_page+0x32/0x260 mm/filemap.c:3875 read_mapping_page include/linux/pagemap.h:892 [inline] ntfs_map_page fs/ntfs/aops.h:75 [inline] ntfs_sync_mft_mirror+0x252/0x1a80 fs/ntfs/mft.c:480 write_mft_record_nolock+0x120b/0x1990 fs/ntfs/mft.c:787 write_mft_record+0x136/0x300 fs/ntfs/mft.h:95 __ntfs_write_inode+0x6bb/0xbf0 fs/ntfs/inode.c:3051 write_inode fs/fs-writeback.c:1483 [inline] __writeback_single_inode+0x720/0xee0 fs/fs-writeback.c:1700 writeback_sb_inodes+0x813/0x1020 fs/fs-writeback.c:1926 wb_writeback+0x45e/0xbe0 fs/fs-writeback.c:2105 wb_do_writeback fs/fs-writeback.c:2252 [inline] wb_workfn+0x400/0xe60 fs/fs-writeback.c:2292 process_one_work kernel/workqueue.c:2653 [inline] process_scheduled_works+0xa60/0x1600 kernel/workqueue.c:2730 worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2811 kthread+0x2fa/0x390 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293 -> #0 (&ni->mrec_lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x37ef/0x7d80 kernel/locking/lockdep.c:5137 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747 map_mft_record+0x50/0x650 fs/ntfs/mft.c:154 ntfs_attr_extend_allocation+0x50d/0x43e0 fs/ntfs/attrib.c:2002 ntfs_prepare_file_for_write fs/ntfs/file.c:391 [inline] ntfs_file_write_iter+0x37d/0x1a80 fs/ntfs/file.c:1914 call_write_iter include/linux/fs.h:2018 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x474/0x9a0 fs/read_write.c:584 ksys_write+0x151/0x260 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 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 *** 4 locks held by syz.2.1191/9423: #0: ffff88802f8339c8 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x2a3/0x330 fs/file.c:1040 #1: ffff888030912418 (sb_writers#32){.+.+}-{0:0}, at: vfs_write+0x21e/0x9a0 fs/read_write.c:580 #2: ffff888059010480 (&sb->s_type->i_mutex_key#46){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline] #2: ffff888059010480 (&sb->s_type->i_mutex_key#46){+.+.}-{3:3}, at: ntfs_file_write_iter+0x7b/0x1a80 fs/ntfs/file.c:1912 #3: ffff888059010100 (&rl->lock){++++}-{3:3}, at: ntfs_attr_extend_allocation+0x505/0x43e0 fs/ntfs/attrib.c:2001 stack backtrace: CPU: 0 PID: 9423 Comm: syz.2.1191 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026 Call Trace: dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106 check_noncircular+0x2fc/0x400 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x37ef/0x7d80 kernel/locking/lockdep.c:5137 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747 map_mft_record+0x50/0x650 fs/ntfs/mft.c:154 ntfs_attr_extend_allocation+0x50d/0x43e0 fs/ntfs/attrib.c:2002 ntfs_prepare_file_for_write fs/ntfs/file.c:391 [inline] ntfs_file_write_iter+0x37d/0x1a80 fs/ntfs/file.c:1914 call_write_iter include/linux/fs.h:2018 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x474/0x9a0 fs/read_write.c:584 ksys_write+0x151/0x260 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fd16239ce59 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd1631bc028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fd162615fa0 RCX: 00007fd16239ce59 RDX: 0000000000000001 RSI: 0000200000000080 RDI: 0000000000000004 RBP: 00007fd162432e6f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fd162616038 R14: 00007fd162615fa0 R15: 00007ffe6d1564e8