====================================================== WARNING: possible circular locking dependency detected 6.12.0-rc1-syzkaller-00330-gfc20a3e57247 #0 Not tainted ------------------------------------------------------ syz.1.1478/17315 is trying to acquire lock: ffff8880594f8858 (&ni->ni_lock#3){+.+.}-{3:3}, at: ntfs_set_state+0x1ff/0x6c0 fs/ntfs3/fsntfs.c:947 but task is already holding lock: ffff88802df4c128 (&wnd->rw_lock /1){+.+.}-{3:3}, at: ntfs_mark_rec_free+0x3f/0x2b0 fs/ntfs3/fsntfs.c:742 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&wnd->rw_lock/1){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 down_write_nested+0xa2/0x220 kernel/locking/rwsem.c:1693 ntfs_mark_rec_free+0x3f/0x2b0 fs/ntfs3/fsntfs.c:742 ni_write_inode+0xb8a/0x1010 fs/ntfs3/frecord.c:3433 write_inode fs/fs-writeback.c:1503 [inline] __writeback_single_inode+0x711/0x10d0 fs/fs-writeback.c:1723 writeback_sb_inodes+0x80c/0x1370 fs/fs-writeback.c:1954 wb_writeback+0x41b/0xbd0 fs/fs-writeback.c:2134 wb_do_writeback fs/fs-writeback.c:2281 [inline] wb_workfn+0x410/0x1090 fs/fs-writeback.c:2321 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3310 worker_thread+0x870/0xd30 kernel/workqueue.c:3391 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #0 (&ni->ni_lock#3){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904 __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 ntfs_mark_rec_free+0x166/0x2b0 fs/ntfs3/fsntfs.c:748 ntfs_create_inode+0xcce/0x3880 fs/ntfs3/inode.c:1691 ntfs_mkdir+0x3d/0x50 fs/ntfs3/namei.c:207 vfs_mkdir+0x2f9/0x4f0 fs/namei.c:4257 do_mkdirat+0x264/0x3a0 fs/namei.c:4280 __do_sys_mkdirat fs/namei.c:4295 [inline] __se_sys_mkdirat fs/namei.c:4293 [inline] __x64_sys_mkdirat+0x87/0xa0 fs/namei.c:4293 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(&wnd->rw_lock/1); lock(&ni->ni_lock#3); lock(&wnd->rw_lock/1); lock(&ni->ni_lock#3); *** DEADLOCK *** 4 locks held by syz.1.1478/17315: #0: ffff88802eca6420 (sb_writers#22){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:515 #1: ffff8880594fdbb8 (&type->i_mutex_dir_key#15/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:850 [inline] #1: ffff8880594fdbb8 (&type->i_mutex_dir_key#15/1){+.+.}-{3:3}, at: filename_create+0x260/0x540 fs/namei.c:4026 #2: ffff8880594fd920 (&ni->ni_lock#2/5){+.+.}-{3:3}, at: ni_lock_dir fs/ntfs3/ntfs_fs.h:1114 [inline] #2: ffff8880594fd920 (&ni->ni_lock#2/5){+.+.}-{3:3}, at: ntfs_create_inode+0x20f/0x3880 fs/ntfs3/inode.c:1214 #3: ffff88802df4c128 ( &wnd->rw_lock/1){+.+.}-{3:3}, at: ntfs_mark_rec_free+0x3f/0x2b0 fs/ntfs3/fsntfs.c:742 stack backtrace: CPU: 0 UID: 0 PID: 17315 Comm: syz.1.1478 Not tainted 6.12.0-rc1-syzkaller-00330-gfc20a3e57247 #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_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2074 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904 __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 ntfs_mark_rec_free+0x166/0x2b0 fs/ntfs3/fsntfs.c:748 ntfs_create_inode+0xcce/0x3880 fs/ntfs3/inode.c:1691 ntfs_mkdir+0x3d/0x50 fs/ntfs3/namei.c:207 vfs_mkdir+0x2f9/0x4f0 fs/namei.c:4257 do_mkdirat+0x264/0x3a0 fs/namei.c:4280 __do_sys_mkdirat fs/namei.c:4295 [inline] __se_sys_mkdirat fs/namei.c:4293 [inline] __x64_sys_mkdirat+0x87/0xa0 fs/namei.c:4293 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:0x7ff73f57dff9 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:00007ff7403fa038 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007ff73f736130 RCX: 00007ff73f57dff9 RDX: 0000000000000000 RSI: 00000000200005c0 RDI: ffffffffffffff9c RBP: 00007ff73f5f0296 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007ff73f736130 R15: 00007ffeeec70d98 Buffer I/O error on dev loop1, logical block 19, lost sync page write