====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz-executor/4194 is trying to acquire lock: ffff888026922a58 (&ei->i_data_sem/2){++++}-{3:3}, at: ext4_map_blocks+0x33c/0x1b30 fs/ext4/inode.c:600 but task is already holding lock: ffff8880773d4208 (&s->s_dquot.dqio_sem){++++}-{3:3}, at: v2_write_dquot+0x12b/0x190 fs/quota/quota_v2.c:354 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&s->s_dquot.dqio_sem){++++}-{3:3}: down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498 v2_read_dquot+0x4a/0x110 fs/quota/quota_v2.c:332 dquot_acquire+0x152/0x520 fs/quota/dquot.c:488 ext4_acquire_dquot+0x2d9/0x4a0 fs/ext4/super.c:6232 dqget+0x72b/0xc30 fs/quota/dquot.c:1010 __dquot_initialize+0x3c3/0xcd0 fs/quota/dquot.c:1539 ext4_mkdir+0x1a5/0xce0 fs/ext4/namei.c:3059 vfs_mkdir+0x387/0x570 fs/namei.c:4073 do_mkdirat+0x1df/0x5b0 fs/namei.c:4098 __do_sys_mkdirat fs/namei.c:4113 [inline] __se_sys_mkdirat fs/namei.c:4111 [inline] __x64_sys_mkdirat+0x85/0x90 fs/namei.c:4111 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #1 (&dquot->dq_lock){+.+.}-{3:3}: __mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 dquot_commit+0x5a/0x410 fs/quota/dquot.c:532 ext4_write_dquot+0x1f0/0x360 fs/ext4/super.c:6212 mark_dquot_dirty fs/quota/dquot.c:397 [inline] mark_all_dquot_dirty+0xf9/0x400 fs/quota/dquot.c:437 __dquot_free_space+0x7ca/0xb90 fs/quota/dquot.c:1964 dquot_free_space_nodirty include/linux/quotaops.h:369 [inline] dquot_free_space include/linux/quotaops.h:374 [inline] dquot_free_block include/linux/quotaops.h:385 [inline] ext4_mb_clear_bb fs/ext4/mballoc.c:6164 [inline] ext4_free_blocks+0x1b2b/0x24d0 fs/ext4/mballoc.c:6294 ext4_remove_blocks fs/ext4/extents.c:2507 [inline] ext4_ext_rm_leaf fs/ext4/extents.c:2691 [inline] ext4_ext_remove_space+0x211e/0x42b0 fs/ext4/extents.c:2939 ext4_ext_truncate+0x192/0x240 fs/ext4/extents.c:4489 ext4_truncate+0xa09/0x10f0 fs/ext4/inode.c:4263 ext4_evict_inode+0xb4f/0x1090 fs/ext4/inode.c:291 evict+0x4c9/0x8d0 fs/inode.c:647 do_unlinkat+0x3e7/0x710 fs/namei.c:4363 __do_sys_unlink fs/namei.c:4404 [inline] __se_sys_unlink fs/namei.c:4402 [inline] __x64_sys_unlink+0x45/0x50 fs/namei.c:4402 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (&ei->i_data_sem/2){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623 down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498 ext4_map_blocks+0x33c/0x1b30 fs/ext4/inode.c:600 ext4_getblk+0x176/0x670 fs/ext4/inode.c:872 ext4_bread+0x26/0x180 fs/ext4/inode.c:925 ext4_quota_write+0x236/0x580 fs/ext4/super.c:6623 write_blk fs/quota/quota_tree.c:64 [inline] get_free_dqblk+0x387/0x7d0 fs/quota/quota_tree.c:125 do_insert_tree+0x214/0x1970 fs/quota/quota_tree.c:335 do_insert_tree+0x5b1/0x1970 fs/quota/quota_tree.c:366 do_insert_tree+0x5b1/0x1970 fs/quota/quota_tree.c:366 do_insert_tree+0x5b1/0x1970 fs/quota/quota_tree.c:366 dq_insert_tree fs/quota/quota_tree.c:392 [inline] qtree_write_dquot+0x361/0x4b0 fs/quota/quota_tree.c:411 v2_write_dquot+0x108/0x190 fs/quota/quota_v2.c:358 dquot_acquire+0x2d5/0x520 fs/quota/dquot.c:497 ext4_acquire_dquot+0x2d9/0x4a0 fs/ext4/super.c:6232 dqget+0x72b/0xc30 fs/quota/dquot.c:1010 __dquot_initialize+0x3c3/0xcd0 fs/quota/dquot.c:1539 ext4_unlink+0x168/0x500 fs/ext4/namei.c:3366 vfs_unlink+0x385/0x600 fs/namei.c:4288 do_unlinkat+0x391/0x710 fs/namei.c:4356 __do_sys_unlink fs/namei.c:4404 [inline] __se_sys_unlink fs/namei.c:4402 [inline] __x64_sys_unlink+0x45/0x50 fs/namei.c:4402 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Chain exists of: &ei->i_data_sem/2 --> &dquot->dq_lock --> &s->s_dquot.dqio_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&s->s_dquot.dqio_sem); lock(&dquot->dq_lock); lock(&s->s_dquot.dqio_sem); lock(&ei->i_data_sem/2); *** DEADLOCK *** 5 locks held by syz-executor/4194: #0: ffff8880773d4460 (sb_writers#5){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:386 #1: ffff8880269217e0 (&type->i_mutex_dir_key#4/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:822 [inline] #1: ffff8880269217e0 (&type->i_mutex_dir_key#4/1){+.+.}-{3:3}, at: do_unlinkat+0x1c8/0x710 fs/namei.c:4339 #2: ffff88802694bfc0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #2: ffff88802694bfc0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: vfs_unlink+0xee/0x600 fs/namei.c:4277 #3: ffff88807acbf068 (&dquot->dq_lock){+.+.}-{3:3}, at: dquot_acquire+0x63/0x520 fs/quota/dquot.c:485 #4: ffff8880773d4208 (&s->s_dquot.dqio_sem){++++}-{3:3}, at: v2_write_dquot+0x12b/0x190 fs/quota/quota_v2.c:354 stack backtrace: CPU: 0 PID: 4194 Comm: syz-executor Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623 down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498 ext4_map_blocks+0x33c/0x1b30 fs/ext4/inode.c:600 ext4_getblk+0x176/0x670 fs/ext4/inode.c:872 ext4_bread+0x26/0x180 fs/ext4/inode.c:925 ext4_quota_write+0x236/0x580 fs/ext4/super.c:6623 write_blk fs/quota/quota_tree.c:64 [inline] get_free_dqblk+0x387/0x7d0 fs/quota/quota_tree.c:125 do_insert_tree+0x214/0x1970 fs/quota/quota_tree.c:335 do_insert_tree+0x5b1/0x1970 fs/quota/quota_tree.c:366 do_insert_tree+0x5b1/0x1970 fs/quota/quota_tree.c:366 do_insert_tree+0x5b1/0x1970 fs/quota/quota_tree.c:366 dq_insert_tree fs/quota/quota_tree.c:392 [inline] qtree_write_dquot+0x361/0x4b0 fs/quota/quota_tree.c:411 v2_write_dquot+0x108/0x190 fs/quota/quota_v2.c:358 dquot_acquire+0x2d5/0x520 fs/quota/dquot.c:497 ext4_acquire_dquot+0x2d9/0x4a0 fs/ext4/super.c:6232 dqget+0x72b/0xc30 fs/quota/dquot.c:1010 __dquot_initialize+0x3c3/0xcd0 fs/quota/dquot.c:1539 ext4_unlink+0x168/0x500 fs/ext4/namei.c:3366 vfs_unlink+0x385/0x600 fs/namei.c:4288 do_unlinkat+0x391/0x710 fs/namei.c:4356 __do_sys_unlink fs/namei.c:4404 [inline] __se_sys_unlink fs/namei.c:4402 [inline] __x64_sys_unlink+0x45/0x50 fs/namei.c:4402 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f4dd694df47 Code: 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 57 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007ffdd4ddd5a8 EFLAGS: 00000206 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f4dd694df47 RDX: 00007ffdd4ddd5d0 RSI: 00007ffdd4ddd660 RDI: 00007ffdd4ddd660 RBP: 00007ffdd4ddd660 R08: 00007ffdd4dde660 R09: 00000000ffffffff R10: 0000000000000100 R11: 0000000000000206 R12: 00007ffdd4dde750 R13: 00007f4dd69e41ca R14: 000000000007c392 R15: 00007ffdd4ddf820