====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.0.1597/10388 is trying to acquire lock: ffff8880592e09c0 (&ocfs2_sysfile_lock_key[ORPHAN_DIR_SYSTEM_INODE]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] ffff8880592e09c0 (&ocfs2_sysfile_lock_key[ORPHAN_DIR_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_del_inode_from_orphan+0x112/0x700 fs/ocfs2/namei.c:2730 but task is already holding lock: ffff8880593b94a0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{4:4}, at: ocfs2_dio_end_io_write+0x1a6/0xf30 fs/ocfs2/aops.c:2298 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&ocfs2_quota_ip_alloc_sem_key){++++}-{4:4}: down_write+0x92/0x200 kernel/locking/rwsem.c:1590 ocfs2_create_local_dquot+0x157/0xb30 fs/ocfs2/quota_local.c:1227 ocfs2_acquire_dquot+0x626/0xb00 fs/ocfs2/quota_global.c:883 dqget+0x693/0x1180 fs/quota/dquot.c:977 dquot_set_dqblk+0x2b/0x1290 fs/quota/dquot.c:2820 quota_setquota+0x4c4/0x5e0 fs/quota/quota.c:310 do_quotactl+0xaf6/0x13d0 fs/quota/quota.c:802 __do_sys_quotactl fs/quota/quota.c:961 [inline] __se_sys_quotactl fs/quota/quota.c:917 [inline] __x64_sys_quotactl+0x1b3/0x440 fs/quota/quota.c:917 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (&dquot->dq_lock){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:598 [inline] __mutex_lock+0x193/0x1060 kernel/locking/mutex.c:760 wait_on_dquot fs/quota/dquot.c:354 [inline] dqget+0x5f1/0x1180 fs/quota/dquot.c:972 __dquot_initialize+0x586/0xd50 fs/quota/dquot.c:1505 ocfs2_get_init_inode+0xe7/0x1b0 fs/ocfs2/namei.c:205 ocfs2_mknod+0x974/0x2540 fs/ocfs2/namei.c:313 vfs_mknod+0x5da/0x8e0 fs/namei.c:4235 do_mknodat+0x30f/0x5d0 fs/namei.c:4295 __do_sys_mknodat fs/namei.c:4313 [inline] __se_sys_mknodat fs/namei.c:4310 [inline] __x64_sys_mknodat+0xaf/0xe0 fs/namei.c:4310 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}: down_write+0x92/0x200 kernel/locking/rwsem.c:1590 inode_lock include/linux/fs.h:869 [inline] ocfs2_remove_inode+0x15b/0x8a0 fs/ocfs2/inode.c:731 ocfs2_wipe_inode+0x446/0x1210 fs/ocfs2/inode.c:894 ocfs2_delete_inode fs/ocfs2/inode.c:1155 [inline] ocfs2_evict_inode+0x6e0/0x1680 fs/ocfs2/inode.c:1292 evict+0x3e6/0x920 fs/inode.c:810 iput_final fs/inode.c:1897 [inline] iput fs/inode.c:1923 [inline] iput+0x521/0x880 fs/inode.c:1909 do_unlinkat+0x518/0x6a0 fs/namei.c:4657 __do_sys_unlink fs/namei.c:4696 [inline] __se_sys_unlink fs/namei.c:4694 [inline] __x64_sys_unlink+0xc5/0x110 fs/namei.c:4694 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&ocfs2_sysfile_lock_key[ORPHAN_DIR_SYSTEM_INODE]){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x12a6/0x1ce0 kernel/locking/lockdep.c:5237 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5825 down_write+0x92/0x200 kernel/locking/rwsem.c:1590 inode_lock include/linux/fs.h:869 [inline] ocfs2_del_inode_from_orphan+0x112/0x700 fs/ocfs2/namei.c:2730 ocfs2_dio_end_io_write+0x2cb/0xf30 fs/ocfs2/aops.c:2306 ocfs2_dio_end_io+0x136/0x2c0 fs/ocfs2/aops.c:2404 dio_complete+0x224/0x970 fs/direct-io.c:281 __blockdev_direct_IO+0x3027/0x3c40 fs/direct-io.c:1303 ocfs2_direct_IO+0x263/0x360 fs/ocfs2/aops.c:2441 generic_file_direct_write+0x19a/0x410 mm/filemap.c:4109 __generic_file_write_iter+0x11b/0x240 mm/filemap.c:4278 ocfs2_file_write_iter+0xbc4/0x21b0 fs/ocfs2/file.c:2469 do_iter_readv_writev+0x662/0x9e0 fs/read_write.c:827 vfs_writev+0x35f/0xde0 fs/read_write.c:1057 do_pwritev+0x1a6/0x270 fs/read_write.c:1153 __do_sys_pwritev2 fs/read_write.c:1211 [inline] __se_sys_pwritev2 fs/read_write.c:1202 [inline] __x64_sys_pwritev2+0xef/0x160 fs/read_write.c:1202 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &ocfs2_sysfile_lock_key[ORPHAN_DIR_SYSTEM_INODE] --> &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[ORPHAN_DIR_SYSTEM_INODE]); *** DEADLOCK *** 3 locks held by syz.0.1597/10388: #0: ffff88802fee6428 (sb_writers#23){.+.+}-{0:0}, at: do_pwritev+0x1a6/0x270 fs/read_write.c:1153 #1: ffff8880593b9800 (&sb->s_type->i_mutex_key#28){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] #1: ffff8880593b9800 (&sb->s_type->i_mutex_key#28){+.+.}-{4:4}, at: ocfs2_file_write_iter+0x11cd/0x21b0 fs/ocfs2/file.c:2399 #2: ffff8880593b94a0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{4:4}, at: ocfs2_dio_end_io_write+0x1a6/0xf30 fs/ocfs2/aops.c:2298 stack backtrace: CPU: 0 UID: 0 PID: 10388 Comm: syz.0.1597 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_circular_bug+0x275/0x350 kernel/locking/lockdep.c:2043 check_noncircular+0x14c/0x170 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x12a6/0x1ce0 kernel/locking/lockdep.c:5237 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5825 down_write+0x92/0x200 kernel/locking/rwsem.c:1590 inode_lock include/linux/fs.h:869 [inline] ocfs2_del_inode_from_orphan+0x112/0x700 fs/ocfs2/namei.c:2730 ocfs2_dio_end_io_write+0x2cb/0xf30 fs/ocfs2/aops.c:2306 ocfs2_dio_end_io+0x136/0x2c0 fs/ocfs2/aops.c:2404 dio_complete+0x224/0x970 fs/direct-io.c:281 __blockdev_direct_IO+0x3027/0x3c40 fs/direct-io.c:1303 ocfs2_direct_IO+0x263/0x360 fs/ocfs2/aops.c:2441 generic_file_direct_write+0x19a/0x410 mm/filemap.c:4109 __generic_file_write_iter+0x11b/0x240 mm/filemap.c:4278 ocfs2_file_write_iter+0xbc4/0x21b0 fs/ocfs2/file.c:2469 do_iter_readv_writev+0x662/0x9e0 fs/read_write.c:827 vfs_writev+0x35f/0xde0 fs/read_write.c:1057 do_pwritev+0x1a6/0x270 fs/read_write.c:1153 __do_sys_pwritev2 fs/read_write.c:1211 [inline] __se_sys_pwritev2 fs/read_write.c:1202 [inline] __x64_sys_pwritev2+0xef/0x160 fs/read_write.c:1202 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fc5c358ebe9 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:00007fc5c17f6038 EFLAGS: 00000246 ORIG_RAX: 0000000000000148 RAX: ffffffffffffffda RBX: 00007fc5c37b5fa0 RCX: 00007fc5c358ebe9 RDX: 0000000000000001 RSI: 0000200000000240 RDI: 0000000000000004 RBP: 00007fc5c3611e19 R08: 0000000000000000 R09: 0000000000000003 R10: 0000000000002000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fc5c37b6038 R14: 00007fc5c37b5fa0 R15: 00007ffc67f0e338