loop0: detected capacity change from 0 to 4096 ============================================ WARNING: possible recursive locking detected 6.12.0-rc6-syzkaller-00077-g2e1b3cc9d7f7 #0 Not tainted -------------------------------------------- syz.0.711/9147 is trying to acquire lock: ffff88805bc8b468 (&ni->ni_lock#3/5){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1109 [inline] ffff88805bc8b468 (&ni->ni_lock#3/5){+.+.}-{3:3}, at: mi_read+0x466/0x660 fs/ntfs3/record.c:148 but task is already holding lock: ffff88805bce9708 (&ni->ni_lock#3/5){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1109 [inline] ffff88805bce9708 (&ni->ni_lock#3/5){+.+.}-{3:3}, at: ntfs_link+0x107/0x290 fs/ntfs3/namei.c:141 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&ni->ni_lock#3/5); lock(&ni->ni_lock#3/5); *** DEADLOCK *** May be due to missing lock nesting notation 6 locks held by syz.0.711/9147: #0: ffff88802b92a420 (sb_writers#13){.+.+}-{0:0}, at: filename_create+0x10d/0x530 fs/namei.c:4019 #1: ffff88805bceafa8 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:850 [inline] #1: ffff88805bceafa8 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: filename_create+0x1c2/0x530 fs/namei.c:4026 #2: ffff88805bce99a0 (&sb->s_type->i_mutex_key#27){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:815 [inline] #2: ffff88805bce99a0 (&sb->s_type->i_mutex_key#27){+.+.}-{3:3}, at: vfs_link+0x652/0xe60 fs/namei.c:4730 #3: ffff88805bcead10 (&ni->ni_lock/6){+.+.}-{3:3}, at: ni_lock_dir fs/ntfs3/ntfs_fs.h:1114 [inline] #3: ffff88805bcead10 (&ni->ni_lock/6){+.+.}-{3:3}, at: ntfs_link+0xec/0x290 fs/ntfs3/namei.c:139 #4: ffff88805bce9708 (&ni->ni_lock#3/5){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1109 [inline] #4: ffff88805bce9708 (&ni->ni_lock#3/5){+.+.}-{3:3}, at: ntfs_link+0x107/0x290 fs/ntfs3/namei.c:141 #5: ffff888024646128 (&wnd->rw_lock/1){+.+.}-{3:3}, at: ntfs_look_free_mft+0x346/0xdd0 fs/ntfs3/fsntfs.c:571 stack backtrace: CPU: 0 UID: 0 PID: 9147 Comm: syz.0.711 Not tainted 6.12.0-rc6-syzkaller-00077-g2e1b3cc9d7f7 #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+0x116/0x1f0 lib/dump_stack.c:120 print_deadlock_bug+0x2e3/0x410 kernel/locking/lockdep.c:3037 check_deadlock kernel/locking/lockdep.c:3089 [inline] validate_chain kernel/locking/lockdep.c:3891 [inline] __lock_acquire+0x2185/0x3ce0 kernel/locking/lockdep.c:5202 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 ni_lock fs/ntfs3/ntfs_fs.h:1109 [inline] mi_read+0x466/0x660 fs/ntfs3/record.c:148 mi_format_new+0x3a1/0x580 fs/ntfs3/record.c:419 ni_add_subrecord+0xd1/0x4f0 fs/ntfs3/frecord.c:374 ntfs_look_free_mft+0x209/0xdd0 fs/ntfs3/fsntfs.c:715 ni_create_attr_list+0x8d1/0x14c0 fs/ntfs3/frecord.c:878 ni_ins_attr_ext+0x236/0xae0 fs/ntfs3/frecord.c:976 ni_insert_attr+0x30b/0x860 fs/ntfs3/frecord.c:1143 ni_insert_resident+0xd2/0x3a0 fs/ntfs3/frecord.c:1527 ni_add_name+0x48d/0x820 fs/ntfs3/frecord.c:3112 ntfs_link_inode+0x172/0x1d0 fs/ntfs3/inode.c:1735 ntfs_link+0x127/0x290 fs/ntfs3/namei.c:146 vfs_link+0x845/0xe60 fs/namei.c:4739 do_linkat+0x45c/0x590 fs/namei.c:4809 __do_sys_link fs/namei.c:4843 [inline] __se_sys_link fs/namei.c:4841 [inline] __x64_sys_link+0x7d/0xa0 fs/namei.c:4841 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f3ad477e719 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:00007f3ad55d2038 EFLAGS: 00000246 ORIG_RAX: 0000000000000056 RAX: ffffffffffffffda RBX: 00007f3ad4935f80 RCX: 00007f3ad477e719 RDX: 0000000000000000 RSI: 0000000020000bc0 RDI: 0000000020001240 RBP: 00007f3ad47f139e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f3ad4935f80 R15: 00007ffd6116c7c8