====================================================== WARNING: possible circular locking dependency detected 6.17.0-rc1-syzkaller-g8f5ae30d69d7 #0 Not tainted ------------------------------------------------------ syz.3.348/8438 is trying to acquire lock: ffff0000f310d100 (&ocfs2_sysfile_lock_key[ORPHAN_DIR_SYSTEM_INODE]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] ffff0000f310d100 (&ocfs2_sysfile_lock_key[ORPHAN_DIR_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_del_inode_from_orphan+0x100/0x608 fs/ocfs2/namei.c:2730 but task is already holding lock: ffff0000f33e0660 (&ocfs2_quota_ip_alloc_sem_key){++++}-{4:4}, at: ocfs2_dio_end_io_write fs/ocfs2/aops.c:2298 [inline] ffff0000f33e0660 (&ocfs2_quota_ip_alloc_sem_key){++++}-{4:4}, at: ocfs2_dio_end_io+0x32c/0xe7c fs/ocfs2/aops.c:2404 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+0x50/0xc0 kernel/locking/rwsem.c:1590 ocfs2_create_local_dquot+0x164/0x1444 fs/ocfs2/quota_local.c:1227 ocfs2_acquire_dquot+0x6a8/0xa10 fs/ocfs2/quota_global.c:883 dqget+0x654/0xccc fs/quota/dquot.c:977 dquot_set_dqblk+0x40/0xe50 fs/quota/dquot.c:2820 quota_setquota+0x3b4/0x3bc fs/quota/quota.c:310 do_quotactl+0x65c/0x738 fs/quota/quota.c:802 __do_sys_quotactl fs/quota/quota.c:961 [inline] __se_sys_quotactl fs/quota/quota.c:917 [inline] __arm64_sys_quotactl+0x298/0xb34 fs/quota/quota.c:917 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x58/0x180 arch/arm64/kernel/entry-common.c:879 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 -> #2 (&dquot->dq_lock){+.+.}-{4:4}: __mutex_lock_common+0x1d0/0x24ac kernel/locking/mutex.c:598 __mutex_lock kernel/locking/mutex.c:760 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:812 wait_on_dquot fs/quota/dquot.c:354 [inline] dqget+0x5e4/0xccc fs/quota/dquot.c:972 __dquot_initialize+0x2d4/0xa80 fs/quota/dquot.c:1505 dquot_initialize+0x24/0x34 fs/quota/dquot.c:1567 ocfs2_get_init_inode+0x134/0x1a8 fs/ocfs2/namei.c:205 ocfs2_mknod+0x734/0x1cf0 fs/ocfs2/namei.c:313 ocfs2_create+0x190/0x474 fs/ocfs2/namei.c:676 lookup_open fs/namei.c:3708 [inline] open_last_lookups fs/namei.c:3807 [inline] path_openat+0x12d8/0x2c40 fs/namei.c:4043 do_filp_open+0x18c/0x36c fs/namei.c:4073 do_sys_openat2+0x11c/0x1b4 fs/open.c:1435 do_sys_open fs/open.c:1450 [inline] __do_sys_openat fs/open.c:1466 [inline] __se_sys_openat fs/open.c:1461 [inline] __arm64_sys_openat+0x120/0x158 fs/open.c:1461 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x58/0x180 arch/arm64/kernel/entry-common.c:879 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 -> #1 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}: down_write+0x50/0xc0 kernel/locking/rwsem.c:1590 inode_lock include/linux/fs.h:869 [inline] ocfs2_remove_inode fs/ocfs2/inode.c:731 [inline] ocfs2_wipe_inode fs/ocfs2/inode.c:894 [inline] ocfs2_delete_inode fs/ocfs2/inode.c:1155 [inline] ocfs2_evict_inode+0x1300/0x3bf8 fs/ocfs2/inode.c:1292 evict+0x414/0x928 fs/inode.c:810 iput_final fs/inode.c:1897 [inline] iput+0x6e4/0x83c fs/inode.c:1923 ocfs2_dentry_iput+0x1d4/0x2d4 fs/ocfs2/dcache.c:407 dentry_unlink_inode+0x36c/0x45c fs/dcache.c:464 __dentry_kill+0x170/0x594 fs/dcache.c:669 dput+0x1b8/0x290 fs/dcache.c:911 ovl_check_rename_whiteout fs/overlayfs/super.c:609 [inline] ovl_make_workdir fs/overlayfs/super.c:704 [inline] ovl_get_workdir+0x8f0/0x1280 fs/overlayfs/super.c:827 ovl_fill_super+0xff4/0x2c38 fs/overlayfs/super.c:1406 vfs_get_super fs/super.c:1325 [inline] get_tree_nodev+0xb4/0x144 fs/super.c:1344 ovl_get_tree+0x28/0x38 fs/overlayfs/params.c:699 vfs_get_tree+0x90/0x28c fs/super.c:1815 do_new_mount+0x278/0x7f4 fs/namespace.c:3805 path_mount+0x5b4/0xde0 fs/namespace.c:4120 do_mount fs/namespace.c:4133 [inline] __do_sys_mount fs/namespace.c:4344 [inline] __se_sys_mount fs/namespace.c:4321 [inline] __arm64_sys_mount+0x3e8/0x468 fs/namespace.c:4321 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x58/0x180 arch/arm64/kernel/entry-common.c:879 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 -> #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+0x1774/0x30a4 kernel/locking/lockdep.c:5237 lock_acquire+0x14c/0x2e0 kernel/locking/lockdep.c:5868 down_write+0x50/0xc0 kernel/locking/rwsem.c:1590 inode_lock include/linux/fs.h:869 [inline] ocfs2_del_inode_from_orphan+0x100/0x608 fs/ocfs2/namei.c:2730 ocfs2_dio_end_io_write fs/ocfs2/aops.c:2306 [inline] ocfs2_dio_end_io+0x3e8/0xe7c fs/ocfs2/aops.c:2404 dio_complete+0x238/0x6bc fs/direct-io.c:281 __blockdev_direct_IO+0x2238/0x2818 fs/direct-io.c:1303 ocfs2_direct_IO+0x210/0x280 fs/ocfs2/aops.c:2441 generic_file_direct_write+0x1a8/0x350 mm/filemap.c:4109 __generic_file_write_iter+0x10c/0x204 mm/filemap.c:4278 ocfs2_file_write_iter+0x1328/0x1b84 fs/ocfs2/file.c:2469 do_iter_readv_writev+0x4c0/0x724 fs/read_write.c:-1 vfs_writev+0x29c/0x7cc fs/read_write.c:1057 do_writev+0x128/0x290 fs/read_write.c:1103 __do_sys_writev fs/read_write.c:1171 [inline] __se_sys_writev fs/read_write.c:1168 [inline] __arm64_sys_writev+0x80/0x94 fs/read_write.c:1168 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x58/0x180 arch/arm64/kernel/entry-common.c:879 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 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 *** 4 locks held by syz.3.348/8438: #0: ffff0000cdd902b8 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x1fc/0x2a0 fs/file.c:1232 #1: ffff0000dc278428 (sb_writers#11){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:3107 [inline] #1: ffff0000dc278428 (sb_writers#11){.+.+}-{0:0}, at: vfs_writev+0x21c/0x7cc fs/read_write.c:1055 #2: ffff0000f33e09c0 (&sb->s_type->i_mutex_key#22){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] #2: ffff0000f33e09c0 (&sb->s_type->i_mutex_key#22){++++}-{4:4}, at: ocfs2_file_write_iter+0x3a0/0x1b84 fs/ocfs2/file.c:2399 #3: ffff0000f33e0660 (&ocfs2_quota_ip_alloc_sem_key){++++}-{4:4}, at: ocfs2_dio_end_io_write fs/ocfs2/aops.c:2298 [inline] #3: ffff0000f33e0660 (&ocfs2_quota_ip_alloc_sem_key){++++}-{4:4}, at: ocfs2_dio_end_io+0x32c/0xe7c fs/ocfs2/aops.c:2404 stack backtrace: CPU: 1 UID: 0 PID: 8438 Comm: syz.3.348 Not tainted 6.17.0-rc1-syzkaller-g8f5ae30d69d7 #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/18/2025 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:499 (C) __dump_stack+0x30/0x40 lib/dump_stack.c:94 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 print_circular_bug+0x324/0x32c kernel/locking/lockdep.c:2043 check_noncircular+0x154/0x174 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+0x1774/0x30a4 kernel/locking/lockdep.c:5237 lock_acquire+0x14c/0x2e0 kernel/locking/lockdep.c:5868 down_write+0x50/0xc0 kernel/locking/rwsem.c:1590 inode_lock include/linux/fs.h:869 [inline] ocfs2_del_inode_from_orphan+0x100/0x608 fs/ocfs2/namei.c:2730 ocfs2_dio_end_io_write fs/ocfs2/aops.c:2306 [inline] ocfs2_dio_end_io+0x3e8/0xe7c fs/ocfs2/aops.c:2404 dio_complete+0x238/0x6bc fs/direct-io.c:281 __blockdev_direct_IO+0x2238/0x2818 fs/direct-io.c:1303 ocfs2_direct_IO+0x210/0x280 fs/ocfs2/aops.c:2441 generic_file_direct_write+0x1a8/0x350 mm/filemap.c:4109 __generic_file_write_iter+0x10c/0x204 mm/filemap.c:4278 ocfs2_file_write_iter+0x1328/0x1b84 fs/ocfs2/file.c:2469 do_iter_readv_writev+0x4c0/0x724 fs/read_write.c:-1 vfs_writev+0x29c/0x7cc fs/read_write.c:1057 do_writev+0x128/0x290 fs/read_write.c:1103 __do_sys_writev fs/read_write.c:1171 [inline] __se_sys_writev fs/read_write.c:1168 [inline] __arm64_sys_writev+0x80/0x94 fs/read_write.c:1168 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x58/0x180 arch/arm64/kernel/entry-common.c:879 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596