loop2: detected capacity change from 0 to 4096 ntfs3: loop2: Different NTFS sector size (4096) and media sector size (512). ntfs3: loop2: Inode r=19 is not in use! ntfs3: loop2: Mark volume as dirty due to NTFS errors ====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc5-syzkaller-00018-g55027e689933 #0 Not tainted ------------------------------------------------------ syz.2.1701/10248 is trying to acquire lock: ffff888060c2e0e0 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1123 [inline] ffff888060c2e0e0 (&ni->ni_lock/4){+.+.}-{3:3}, at: mi_read+0x2e1/0x5a0 fs/ntfs3/record.c:148 but task is already holding lock: ffff888060dde0e0 (&ni->ni_lock#2){+.+.}-{3:3}, at: ni_trylock fs/ntfs3/ntfs_fs.h:1143 [inline] ffff888060dde0e0 (&ni->ni_lock#2){+.+.}-{3:3}, at: ni_write_inode+0x1bc/0x1010 fs/ntfs3/frecord.c:3265 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ni->ni_lock#2){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __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 attr_set_size+0x3311/0x4290 fs/ntfs3/attrib.c:866 ntfs_set_ea+0x982/0x16d0 fs/ntfs3/xattr.c:461 ntfs_setxattr+0x144/0x880 fs/ntfs3/xattr.c:937 __vfs_setxattr+0x468/0x4a0 fs/xattr.c:200 __vfs_setxattr_noperm+0x12e/0x660 fs/xattr.c:234 vfs_setxattr+0x221/0x430 fs/xattr.c:321 do_setxattr fs/xattr.c:629 [inline] setxattr+0x25d/0x2f0 fs/xattr.c:652 path_setxattr+0x1c0/0x2a0 fs/xattr.c:671 __do_sys_setxattr fs/xattr.c:687 [inline] __se_sys_setxattr fs/xattr.c:683 [inline] __x64_sys_setxattr+0xbb/0xd0 fs/xattr.c:683 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 -> #0 (&ni->ni_lock/4){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 ni_lock fs/ntfs3/ntfs_fs.h:1123 [inline] mi_read+0x2e1/0x5a0 fs/ntfs3/record.c:148 ntfs_read_mft fs/ntfs3/inode.c:70 [inline] ntfs_iget5+0x49a/0x3b10 fs/ntfs3/inode.c:539 ni_update_parent+0x943/0xdd0 fs/ntfs3/frecord.c:3218 ni_write_inode+0xde9/0x1010 fs/ntfs3/frecord.c:3324 write_inode fs/fs-writeback.c:1497 [inline] __writeback_single_inode+0x6b9/0x10b0 fs/fs-writeback.c:1716 writeback_single_inode+0x21b/0x7a0 fs/fs-writeback.c:1772 write_inode_now+0x1d1/0x260 fs/fs-writeback.c:2822 ntfs_extend+0x39d/0x4a0 fs/ntfs3/file.c:358 ntfs_file_write_iter+0x3ea/0x770 fs/ntfs3/file.c:1124 iter_file_splice_write+0xbd7/0x14e0 fs/splice.c:743 do_splice_from fs/splice.c:941 [inline] direct_splice_actor+0x11e/0x220 fs/splice.c:1164 splice_direct_to_actor+0x58e/0xc90 fs/splice.c:1108 do_splice_direct_actor fs/splice.c:1207 [inline] do_splice_direct+0x28c/0x3e0 fs/splice.c:1233 do_sendfile+0x56d/0xe10 fs/read_write.c:1295 __do_sys_sendfile64 fs/read_write.c:1362 [inline] __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1348 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 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ni->ni_lock#2); lock(&ni->ni_lock/4); lock(&ni->ni_lock#2); lock(&ni->ni_lock/4); *** DEADLOCK *** 3 locks held by syz.2.1701/10248: #0: ffff88806a0e2420 (sb_writers#34){.+.+}-{0:0}, at: direct_splice_actor+0x49/0x220 fs/splice.c:1163 #1: ffff888060dde380 (&sb->s_type->i_mutex_key#42){+.+.}-{3:3}, at: inode_trylock include/linux/fs.h:811 [inline] #1: ffff888060dde380 (&sb->s_type->i_mutex_key#42){+.+.}-{3:3}, at: ntfs_file_write_iter+0x25a/0x770 fs/ntfs3/file.c:1102 #2: ffff888060dde0e0 (&ni->ni_lock#2){+.+.}-{3:3}, at: ni_trylock fs/ntfs3/ntfs_fs.h:1143 [inline] #2: ffff888060dde0e0 (&ni->ni_lock#2){+.+.}-{3:3}, at: ni_write_inode+0x1bc/0x1010 fs/ntfs3/frecord.c:3265 stack backtrace: CPU: 1 PID: 10248 Comm: syz.2.1701 Not tainted 6.10.0-rc5-syzkaller-00018-g55027e689933 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 check_noncircular+0x36a/0x4a0 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+0x18e0/0x5900 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 ni_lock fs/ntfs3/ntfs_fs.h:1123 [inline] mi_read+0x2e1/0x5a0 fs/ntfs3/record.c:148 ntfs_read_mft fs/ntfs3/inode.c:70 [inline] ntfs_iget5+0x49a/0x3b10 fs/ntfs3/inode.c:539 ni_update_parent+0x943/0xdd0 fs/ntfs3/frecord.c:3218 ni_write_inode+0xde9/0x1010 fs/ntfs3/frecord.c:3324 write_inode fs/fs-writeback.c:1497 [inline] __writeback_single_inode+0x6b9/0x10b0 fs/fs-writeback.c:1716 writeback_single_inode+0x21b/0x7a0 fs/fs-writeback.c:1772 write_inode_now+0x1d1/0x260 fs/fs-writeback.c:2822 ntfs_extend+0x39d/0x4a0 fs/ntfs3/file.c:358 ntfs_file_write_iter+0x3ea/0x770 fs/ntfs3/file.c:1124 iter_file_splice_write+0xbd7/0x14e0 fs/splice.c:743 do_splice_from fs/splice.c:941 [inline] direct_splice_actor+0x11e/0x220 fs/splice.c:1164 splice_direct_to_actor+0x58e/0xc90 fs/splice.c:1108 do_splice_direct_actor fs/splice.c:1207 [inline] do_splice_direct+0x28c/0x3e0 fs/splice.c:1233 do_sendfile+0x56d/0xe10 fs/read_write.c:1295 __do_sys_sendfile64 fs/read_write.c:1362 [inline] __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1348 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:0x7f8d06775ae9 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:00007f8d07555048 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f8d06903fa0 RCX: 00007f8d06775ae9 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000005 RBP: 00007f8d067f6746 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000080000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f8d06903fa0 R15: 00007ffd6cd7a018 ntfs3: loop2: ino=1d, "file1" failed to open parent directory r=400 to update ntfs3: loop2: ino=1d, "file1" failed to open parent directory r=400 to update