====================================================== WARNING: possible circular locking dependency detected 6.15.0-rc2-syzkaller-00400-g3088d26962e8 #0 Not tainted ------------------------------------------------------ syz.9.1393/10550 is trying to acquire lock: ffff88807891bf60 ( &ocfs2_quota_ip_alloc_sem_key){++++}-{4:4}, at: ocfs2_lock_global_qf+0x23f/0x2c0 fs/ocfs2/quota_global.c:314 but task is already holding lock: ffff88807891c2c0 ( &ocfs2_sysfile_lock_key[args->fi_sysfile_type] #7){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:867 [inline] #7){+.+.}-{4:4}, at: ocfs2_lock_global_qf+0x21c/0x2c0 fs/ocfs2/quota_global.c:313 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #5 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7){+.+.}-{4:4}: lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 down_write+0x9c/0x220 kernel/locking/rwsem.c:1577 inode_lock include/linux/fs.h:867 [inline] ocfs2_lock_global_qf+0x21c/0x2c0 fs/ocfs2/quota_global.c:313 ocfs2_acquire_dquot+0x2ae/0xb80 fs/ocfs2/quota_global.c:828 dqget+0x772/0xeb0 fs/quota/dquot.c:977 dquot_get_dqblk+0x22/0x60 fs/quota/dquot.c:2684 quota_getquota+0x29d/0x720 fs/quota/quota.c:214 __do_sys_quotactl fs/quota/quota.c:961 [inline] __se_sys_quotactl+0x2b9/0xa40 fs/quota/quota.c:917 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #4 (&dquot->dq_lock){+.+.}-{4:4}: lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 __mutex_lock_common kernel/locking/mutex.c:601 [inline] __mutex_lock+0x1a5/0x10c0 kernel/locking/mutex.c:746 dquot_release+0x69/0x5d0 fs/quota/dquot.c:531 ext4_release_dquot+0x3ea/0x6a0 fs/ext4/super.c:-1 quota_release_workfn+0x3a3/0x650 fs/quota/dquot.c:840 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xac5/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd50 kernel/workqueue.c:3400 kthread+0x7b9/0x940 kernel/kthread.c:464 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #3 (sb_internal){++++}-{0:0}: lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 percpu_down_write+0x54/0x330 kernel/locking/percpu-rwsem.c:229 sb_wait_write fs/super.c:1855 [inline] freeze_super+0x7ce/0xef0 fs/super.c:2063 fs_bdev_freeze+0x1ac/0x320 fs/super.c:1484 bdev_freeze+0xd8/0x220 block/bdev.c:260 ext4_force_shutdown+0x319/0x550 fs/ext4/ioctl.c:822 ext4_ioctl_shutdown fs/ext4/ioctl.c:857 [inline] __ext4_ioctl fs/ext4/ioctl.c:1581 [inline] ext4_ioctl+0x1f34/0x58b0 fs/ext4/ioctl.c:1620 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf3/0x160 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (sb_pagefaults){++++}-{0:0}: lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 percpu_down_read+0x44/0x1b0 include/linux/percpu-rwsem.h:52 __sb_start_write include/linux/fs.h:1783 [inline] sb_start_pagefault include/linux/fs.h:1948 [inline] ext4_page_mkwrite+0x1fa/0x1130 fs/ext4/inode.c:6220 do_page_mkwrite+0x15b/0x340 mm/memory.c:3287 do_shared_fault mm/memory.c:5594 [inline] do_fault mm/memory.c:5656 [inline] do_pte_missing mm/memory.c:4160 [inline] handle_pte_fault+0x10c6/0x61c0 mm/memory.c:5997 __handle_mm_fault mm/memory.c:6140 [inline] handle_mm_fault+0x1129/0x1bf0 mm/memory.c:6309 do_user_addr_fault arch/x86/mm/fault.c:1388 [inline] handle_page_fault arch/x86/mm/fault.c:1480 [inline] exc_page_fault+0x2bb/0x920 arch/x86/mm/fault.c:1538 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 -> #1 (&mm->mmap_lock){++++}-{4:4}: lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 __might_fault+0xc6/0x120 mm/memory.c:7151 _inline_copy_to_user include/linux/uaccess.h:192 [inline] _copy_to_user+0x2c/0xb0 lib/usercopy.c:26 copy_to_user include/linux/uaccess.h:225 [inline] fiemap_fill_next_extent+0x237/0x420 fs/ioctl.c:145 ocfs2_fiemap+0xa07/0x1020 fs/ocfs2/extent_map.c:806 ioctl_fiemap fs/ioctl.c:220 [inline] do_vfs_ioctl+0x1977/0x2750 fs/ioctl.c:840 __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl+0x80/0x160 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{4:4}: check_prev_add kernel/locking/lockdep.c:3166 [inline] check_prevs_add kernel/locking/lockdep.c:3285 [inline] validate_chain+0xa69/0x24e0 kernel/locking/lockdep.c:3909 __lock_acquire+0xad5/0xd80 kernel/locking/lockdep.c:5235 lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 down_write+0x9c/0x220 kernel/locking/rwsem.c:1577 ocfs2_lock_global_qf+0x23f/0x2c0 fs/ocfs2/quota_global.c:314 ocfs2_acquire_dquot+0x2ae/0xb80 fs/ocfs2/quota_global.c:828 dqget+0x772/0xeb0 fs/quota/dquot.c:977 dquot_get_dqblk+0x22/0x60 fs/quota/dquot.c:2684 quota_getquota+0x29d/0x720 fs/quota/quota.c:214 __do_sys_quotactl fs/quota/quota.c:961 [inline] __se_sys_quotactl+0x2b9/0xa40 fs/quota/quota.c:917 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x210 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_quota_ip_alloc_sem_key --> &dquot->dq_lock --> &ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7); lock(&dquot->dq_lock); lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7); lock(&ocfs2_quota_ip_alloc_sem_key); *** DEADLOCK *** 3 locks held by syz.9.1393/10550: #0: ffff8880294960e0 (&type->s_umount_key#77){++++}-{4:4}, at: __super_lock fs/super.c:58 [inline] #0: ffff8880294960e0 (&type->s_umount_key#77){++++}-{4:4}, at: super_lock+0x27c/0x400 fs/super.c:120 #1: ffff88807d0260a8 (&dquot->dq_lock){+.+.}-{4:4}, at: ocfs2_acquire_dquot+0x2a1/0xb80 fs/ocfs2/quota_global.c:823 #2: ffff88807891c2c0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:867 [inline] #2: ffff88807891c2c0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7){+.+.}-{4:4}, at: ocfs2_lock_global_qf+0x21c/0x2c0 fs/ocfs2/quota_global.c:313 stack backtrace: CPU: 0 UID: 0 PID: 10550 Comm: syz.9.1393 Not tainted 6.15.0-rc2-syzkaller-00400-g3088d26962e8 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_circular_bug+0x2e1/0x300 kernel/locking/lockdep.c:2079 check_noncircular+0x142/0x160 kernel/locking/lockdep.c:2211 check_prev_add kernel/locking/lockdep.c:3166 [inline] check_prevs_add kernel/locking/lockdep.c:3285 [inline] validate_chain+0xa69/0x24e0 kernel/locking/lockdep.c:3909 __lock_acquire+0xad5/0xd80 kernel/locking/lockdep.c:5235 lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 down_write+0x9c/0x220 kernel/locking/rwsem.c:1577 ocfs2_lock_global_qf+0x23f/0x2c0 fs/ocfs2/quota_global.c:314 ocfs2_acquire_dquot+0x2ae/0xb80 fs/ocfs2/quota_global.c:828 dqget+0x772/0xeb0 fs/quota/dquot.c:977 dquot_get_dqblk+0x22/0x60 fs/quota/dquot.c:2684 quota_getquota+0x29d/0x720 fs/quota/quota.c:214 __do_sys_quotactl fs/quota/quota.c:961 [inline] __se_sys_quotactl+0x2b9/0xa40 fs/quota/quota.c:917 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f74eb18e169 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:00007f74ebf2e038 EFLAGS: 00000246 ORIG_RAX: 00000000000000b3 RAX: ffffffffffffffda RBX: 00007f74eb3b5fa0 RCX: 00007f74eb18e169 RDX: 0000000030303033 RSI: 00002000000000c0 RDI: ffffffff80000700 RBP: 00007f74eb210a68 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f74eb3b5fa0 R15: 00007ffd3b01ee48