====================================================== WARNING: possible circular locking dependency detected 6.1.119-syzkaller #0 Not tainted ------------------------------------------------------ syz.1.63/4649 is trying to acquire lock: ffff88807013df48 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] ffff88807013df48 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_del_inode_from_orphan+0x155/0x7f0 fs/ocfs2/namei.c:2711 but task is already holding lock: ffff8880701394a0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io_write fs/ocfs2/aops.c:2325 [inline] ffff8880701394a0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io+0x446/0x1250 fs/ocfs2/aops.c:2431 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 down_write+0x36/0x60 kernel/locking/rwsem.c:1573 ocfs2_create_local_dquot+0x1dc/0x1b50 fs/ocfs2/quota_local.c:1231 ocfs2_acquire_dquot+0x7df/0xb60 fs/ocfs2/quota_global.c:866 dqget+0x762/0xe90 fs/quota/dquot.c:986 __dquot_initialize+0x2d9/0xea0 fs/quota/dquot.c:1515 ocfs2_get_init_inode+0x154/0x1c0 fs/ocfs2/namei.c:202 ocfs2_mknod+0xe32/0x2e20 fs/ocfs2/namei.c:308 ocfs2_mkdir+0x1c0/0x4e0 fs/ocfs2/namei.c:655 vfs_mkdir+0x3b6/0x590 fs/namei.c:4106 do_mkdirat+0x225/0x360 fs/namei.c:4131 __do_sys_mkdir fs/namei.c:4151 [inline] __se_sys_mkdir fs/namei.c:4149 [inline] __x64_sys_mkdir+0x6a/0x80 fs/namei.c:4149 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #2 (&dquot->dq_lock){+.+.}-{3:3}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747 wait_on_dquot fs/quota/dquot.c:356 [inline] dqget+0x6dc/0xe90 fs/quota/dquot.c:981 __dquot_initialize+0x2d9/0xea0 fs/quota/dquot.c:1515 ocfs2_get_init_inode+0x154/0x1c0 fs/ocfs2/namei.c:202 ocfs2_mknod+0xe32/0x2e20 fs/ocfs2/namei.c:308 ocfs2_mkdir+0x1c0/0x4e0 fs/ocfs2/namei.c:655 vfs_mkdir+0x3b6/0x590 fs/namei.c:4106 do_mkdirat+0x225/0x360 fs/namei.c:4131 __do_sys_mkdir fs/namei.c:4151 [inline] __se_sys_mkdir fs/namei.c:4149 [inline] __x64_sys_mkdir+0x6a/0x80 fs/namei.c:4149 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #1 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 down_write+0x36/0x60 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] ocfs2_remove_inode fs/ocfs2/inode.c:655 [inline] ocfs2_wipe_inode fs/ocfs2/inode.c:818 [inline] ocfs2_delete_inode fs/ocfs2/inode.c:1079 [inline] ocfs2_evict_inode+0x17ce/0x4c30 fs/ocfs2/inode.c:1216 evict+0x529/0x930 fs/inode.c:701 ocfs2_dentry_iput+0x22e/0x380 fs/ocfs2/dcache.c:418 __dentry_kill+0x436/0x650 fs/dcache.c:611 dentry_kill+0xbb/0x290 dput+0xfb/0x1d0 fs/dcache.c:918 do_renameat2+0xded/0x1440 fs/namei.c:5029 __do_sys_rename fs/namei.c:5073 [inline] __se_sys_rename fs/namei.c:5071 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5071 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 down_write+0x36/0x60 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] ocfs2_del_inode_from_orphan+0x155/0x7f0 fs/ocfs2/namei.c:2711 ocfs2_dio_end_io_write fs/ocfs2/aops.c:2333 [inline] ocfs2_dio_end_io+0x556/0x1250 fs/ocfs2/aops.c:2431 dio_complete+0x24a/0x7b0 fs/direct-io.c:271 __blockdev_direct_IO+0x3ffb/0x4810 fs/direct-io.c:1326 ocfs2_direct_IO+0x250/0x2c0 fs/ocfs2/aops.c:2468 generic_file_direct_write+0x204/0x460 mm/filemap.c:3769 __generic_file_write_iter+0x1c4/0x400 mm/filemap.c:3929 ocfs2_file_write_iter+0x17c6/0x2020 fs/ocfs2/file.c:2467 do_iter_write+0x6e6/0xc40 fs/read_write.c:861 vfs_writev fs/read_write.c:934 [inline] do_pwritev+0x216/0x360 fs/read_write.c:1031 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Chain exists of: &ocfs2_sysfile_lock_key[args->fi_sysfile_type] --> &dquot->dq_lock --> &ocfs2_quota_ip_alloc_sem_key Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ocfs2_quota_ip_alloc_sem_key); lock(&dquot->dq_lock); lock(&ocfs2_quota_ip_alloc_sem_key); lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]); *** DEADLOCK *** 3 locks held by syz.1.63/4649: #0: ffff88807b17c460 (sb_writers#17){.+.+}-{0:0}, at: vfs_writev fs/read_write.c:933 [inline] #0: ffff88807b17c460 (sb_writers#17){.+.+}-{0:0}, at: do_pwritev+0x1fa/0x360 fs/read_write.c:1031 #1: ffff888070139808 (&sb->s_type->i_mutex_key#27){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff888070139808 (&sb->s_type->i_mutex_key#27){+.+.}-{3:3}, at: ocfs2_file_write_iter+0x476/0x2020 fs/ocfs2/file.c:2399 #2: ffff8880701394a0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io_write fs/ocfs2/aops.c:2325 [inline] #2: ffff8880701394a0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io+0x446/0x1250 fs/ocfs2/aops.c:2431 stack backtrace: CPU: 0 PID: 4649 Comm: syz.1.63 Not tainted 6.1.119-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 down_write+0x36/0x60 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] ocfs2_del_inode_from_orphan+0x155/0x7f0 fs/ocfs2/namei.c:2711 ocfs2_dio_end_io_write fs/ocfs2/aops.c:2333 [inline] ocfs2_dio_end_io+0x556/0x1250 fs/ocfs2/aops.c:2431 dio_complete+0x24a/0x7b0 fs/direct-io.c:271 __blockdev_direct_IO+0x3ffb/0x4810 fs/direct-io.c:1326 ocfs2_direct_IO+0x250/0x2c0 fs/ocfs2/aops.c:2468 generic_file_direct_write+0x204/0x460 mm/filemap.c:3769 __generic_file_write_iter+0x1c4/0x400 mm/filemap.c:3929 ocfs2_file_write_iter+0x17c6/0x2020 fs/ocfs2/file.c:2467 do_iter_write+0x6e6/0xc40 fs/read_write.c:861 vfs_writev fs/read_write.c:934 [inline] do_pwritev+0x216/0x360 fs/read_write.c:1031 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f223497ff19 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:00007f22356a6058 EFLAGS: 00000246 ORIG_RAX: 0000000000000148 RAX: ffffffffffffffda RBX: 00007f2234b45fa0 RCX: 00007f223497ff19 RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000004 RBP: 00007f22349f3cc8 R08: 0000000000000000 R09: 0000000000000003 R10: 0000000000007800 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f2234b45fa0 R15: 00007ffe17519708