ntfs3: loop1: ino=5, "/" directory corrupted ============================================ WARNING: possible recursive locking detected 6.12.0-rc1-syzkaller-00031-ge32cde8d2bd7 #0 Not tainted -------------------------------------------- syz.1.81/6090 is trying to acquire lock: ffff88805bc03468 (&ni->ni_lock){+.+.}-{3:3}, at: ntfs_set_state+0x1ff/0x6c0 fs/ntfs3/fsntfs.c:947 but task is already holding lock: ffff88805bc2ad10 (&ni->ni_lock){+.+.}-{3:3}, at: ni_trylock fs/ntfs3/ntfs_fs.h:1129 [inline] ffff88805bc2ad10 (&ni->ni_lock){+.+.}-{3:3}, at: ni_write_inode+0x1bc/0x1010 fs/ntfs3/frecord.c:3333 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&ni->ni_lock); lock(&ni->ni_lock); *** DEADLOCK *** May be due to missing lock nesting notation 4 locks held by syz.1.81/6090: #0: ffff88807045c420 (sb_writers#21){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2931 [inline] #0: ffff88807045c420 (sb_writers#21){.+.+}-{0:0}, at: vfs_writev+0x2d1/0xba0 fs/read_write.c:1062 #1: ffff88805bc2afa8 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:815 [inline] #1: ffff88805bc2afa8 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: __generic_file_fsync+0x97/0x1a0 fs/libfs.c:1532 #2: ffff88805bc2ad10 (&ni->ni_lock){+.+.}-{3:3}, at: ni_trylock fs/ntfs3/ntfs_fs.h:1129 [inline] #2: ffff88805bc2ad10 (&ni->ni_lock){+.+.}-{3:3}, at: ni_write_inode+0x1bc/0x1010 fs/ntfs3/frecord.c:3333 #3: ffff88805bc2b468 (&ni->ni_lock){+.+.}-{3:3}, at: ni_trylock fs/ntfs3/ntfs_fs.h:1129 [inline] #3: ffff88805bc2b468 (&ni->ni_lock){+.+.}-{3:3}, at: ni_update_parent+0x9d2/0xdd0 fs/ntfs3/frecord.c:3298 stack backtrace: CPU: 0 UID: 0 PID: 6090 Comm: syz.1.81 Not tainted 6.12.0-rc1-syzkaller-00031-ge32cde8d2bd7 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3037 check_deadlock kernel/locking/lockdep.c:3089 [inline] validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3891 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 ntfs_set_state+0x1ff/0x6c0 fs/ntfs3/fsntfs.c:947 indx_read+0x5a7/0xc50 indx_find+0x47a/0xbf0 fs/ntfs3/index.c:1181 indx_update_dup+0x485/0x860 fs/ntfs3/index.c:2666 ni_update_parent+0xa18/0xdd0 fs/ntfs3/frecord.c:3301 ni_write_inode+0xd9a/0x1010 fs/ntfs3/frecord.c:3392 write_inode fs/fs-writeback.c:1503 [inline] __writeback_single_inode+0x711/0x10d0 fs/fs-writeback.c:1723 writeback_single_inode+0x1f3/0x660 fs/fs-writeback.c:1779 sync_inode_metadata+0xc4/0x120 fs/fs-writeback.c:2849 __generic_file_fsync+0x134/0x1a0 fs/libfs.c:1539 generic_file_fsync+0x70/0xf0 fs/libfs.c:1569 generic_write_sync include/linux/fs.h:2871 [inline] ntfs_file_write_iter+0x627/0x740 fs/ntfs3/file.c:1198 do_iter_readv_writev+0x600/0x880 vfs_writev+0x376/0xba0 fs/read_write.c:1064 do_pwritev fs/read_write.c:1165 [inline] __do_sys_pwritev2 fs/read_write.c:1224 [inline] __se_sys_pwritev2+0x1ca/0x2d0 fs/read_write.c:1215 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fdb8717dff9 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdb86bff038 EFLAGS: 00000246 ORIG_RAX: 0000000000000148 RAX: ffffffffffffffda RBX: 00007fdb87335f80 RCX: 00007fdb8717dff9 RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000005 RBP: 00007fdb871f0296 R08: 0000000000000000 R09: 0000000000000003 R10: 0000000000007000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fdb87335f80 R15: 00007ffc95a048b8 ntfs3: loop1: Mark volume as dirty due to NTFS errors