======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.2.281/7494 is trying to acquire lock:
ffff8880614e8598 (&dquot->dq_lock){+.+.}-{4:4}, at: wait_on_dquot fs/quota/dquot.c:357 [inline]
ffff8880614e8598 (&dquot->dq_lock){+.+.}-{4:4}, at: dqget+0x72f/0xf10 fs/quota/dquot.c:975
but task is already holding lock:
ffff88805fe3bdc0 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1028 [inline]
ffff88805fe3bdc0 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_reserve_suballoc_bits+0x16a/0x4940 fs/ocfs2/suballoc.c:857
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #3 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}:
down_write+0x3a/0x50 kernel/locking/rwsem.c:1590
inode_lock include/linux/fs.h:1028 [inline]
ocfs2_remove_inode fs/ocfs2/inode.c:733 [inline]
ocfs2_wipe_inode fs/ocfs2/inode.c:896 [inline]
ocfs2_delete_inode fs/ocfs2/inode.c:1157 [inline]
ocfs2_evict_inode+0x1539/0x44c0 fs/ocfs2/inode.c:1299
evict+0x61e/0xb10 fs/inode.c:846
d_delete_notify include/linux/fsnotify.h:377 [inline]
vfs_rmdir+0x42d/0x6f0 fs/namei.c:5351
filename_rmdir+0x292/0x520 fs/namei.c:5393
__do_sys_rmdir fs/namei.c:5416 [inline]
__se_sys_rmdir+0x2e/0x140 fs/namei.c:5413
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
-> #2 (&ocfs2_sysfile_lock_key[ORPHAN_DIR_SYSTEM_INODE]){+.+.}-{4:4}:
down_write+0x3a/0x50 kernel/locking/rwsem.c:1590
inode_lock include/linux/fs.h:1028 [inline]
ocfs2_del_inode_from_orphan+0x12e/0x7a0 fs/ocfs2/namei.c:2731
ocfs2_dio_end_io_write fs/ocfs2/aops.c:2305 [inline]
ocfs2_dio_end_io+0x545/0x1210 fs/ocfs2/aops.c:2403
dio_complete+0x25e/0x790 fs/direct-io.c:281
__blockdev_direct_IO+0x2d0e/0x3330 fs/direct-io.c:1303
ocfs2_direct_IO+0x253/0x2c0 fs/ocfs2/aops.c:2440
generic_file_direct_write+0x1dc/0x3e0 mm/filemap.c:4248
__generic_file_write_iter+0x120/0x240 mm/filemap.c:4417
ocfs2_file_write_iter+0x1666/0x1ed0 fs/ocfs2/file.c:2476
do_iter_readv_writev+0x62b/0x8d0 fs/read_write.c:-1
vfs_writev+0x345/0x9a0 fs/read_write.c:1059
do_pwritev fs/read_write.c:1155 [inline]
__do_sys_pwritev2 fs/read_write.c:1213 [inline]
__se_sys_pwritev2+0x187/0x2b0 fs/read_write.c:1204
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
-> #1 (&ocfs2_quota_ip_alloc_sem_key){++++}-{4:4}:
down_write+0x3a/0x50 kernel/locking/rwsem.c:1590
ocfs2_create_local_dquot+0x1a5/0x1af0 fs/ocfs2/quota_local.c:1227
ocfs2_acquire_dquot+0x816/0xb70 fs/ocfs2/quota_global.c:883
dqget+0x7b6/0xf10 fs/quota/dquot.c:980
dquot_set_dqblk+0x2b/0xfa0 fs/quota/dquot.c:2823
quota_setquota+0x4e0/0x590 fs/quota/quota.c:310
__do_sys_quotactl fs/quota/quota.c:961 [inline]
__se_sys_quotactl+0x2cd/0x9e0 fs/quota/quota.c:917
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
-> #0 (&dquot->dq_lock){+.+.}-{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+0x15a5/0x2cf0 kernel/locking/lockdep.c:5237
lock_acquire+0xf0/0x2e0 kernel/locking/lockdep.c:5868
__mutex_lock_common kernel/locking/rtmutex_api.c:533 [inline]
mutex_lock_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:552
wait_on_dquot fs/quota/dquot.c:357 [inline]
dqget+0x72f/0xf10 fs/quota/dquot.c:975
__dquot_initialize+0x3ba/0xd30 fs/quota/dquot.c:1508
ocfs2_get_init_inode+0x147/0x1c0 fs/ocfs2/namei.c:206
ocfs2_mknod+0xa67/0x2290 fs/ocfs2/namei.c:314
ocfs2_create+0x195/0x490 fs/ocfs2/namei.c:677
vfs_create+0x2d3/0x470 fs/namei.c:4176
filename_mknodat+0x3ec/0x670 fs/namei.c:5142
__do_sys_mknod fs/namei.c:5179 [inline]
__se_sys_mknod+0x3a/0x150 fs/namei.c:5176
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x14d/0xf80 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:
&dquot->dq_lock --> &ocfs2_sysfile_lock_key[ORPHAN_DIR_SYSTEM_INODE] --> &ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]);
lock(&ocfs2_sysfile_lock_key[ORPHAN_DIR_SYSTEM_INODE]);
lock(&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]);
lock(&dquot->dq_lock);
*** DEADLOCK ***
3 locks held by syz.2.281/7494:
#0: ffff888034ad6480 (sb_writers#25){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:493
#1: ffff8880405f0b80 (&type->i_mutex_dir_key#22/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1073 [inline]
#1: ffff8880405f0b80 (&type->i_mutex_dir_key#22/1){+.+.}-{4:4}, at: __start_dirop fs/namei.c:2923 [inline]
#1: ffff8880405f0b80 (&type->i_mutex_dir_key#22/1){+.+.}-{4:4}, at: start_dirop fs/namei.c:2934 [inline]
#1: ffff8880405f0b80 (&type->i_mutex_dir_key#22/1){+.+.}-{4:4}, at: filename_create+0x200/0x370 fs/namei.c:4922
#2: ffff88805fe3bdc0 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1028 [inline]
#2: ffff88805fe3bdc0 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_reserve_suballoc_bits+0x16a/0x4940 fs/ocfs2/suballoc.c:857
stack backtrace:
CPU: 1 UID: 0 PID: 7494 Comm: syz.2.281 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Call Trace:
<TASK>
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
print_circular_bug+0x2e1/0x300 kernel/locking/lockdep.c:2043
check_noncircular+0x12e/0x150 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+0x15a5/0x2cf0 kernel/locking/lockdep.c:5237
lock_acquire+0xf0/0x2e0 kernel/locking/lockdep.c:5868
__mutex_lock_common kernel/locking/rtmutex_api.c:533 [inline]
mutex_lock_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:552
wait_on_dquot fs/quota/dquot.c:357 [inline]
dqget+0x72f/0xf10 fs/quota/dquot.c:975
__dquot_initialize+0x3ba/0xd30 fs/quota/dquot.c:1508
ocfs2_get_init_inode+0x147/0x1c0 fs/ocfs2/namei.c:206
ocfs2_mknod+0xa67/0x2290 fs/ocfs2/namei.c:314
ocfs2_create+0x195/0x490 fs/ocfs2/namei.c:677
vfs_create+0x2d3/0x470 fs/namei.c:4176
filename_mknodat+0x3ec/0x670 fs/namei.c:5142
__do_sys_mknod fs/namei.c:5179 [inline]
__se_sys_mknod+0x3a/0x150 fs/namei.c:5176
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fd81014c629
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fd80e385028 EFLAGS: 00000246 ORIG_RAX: 0000000000000085
RAX: ffffffffffffffda RBX: 00007fd8103c6090 RCX: 00007fd81014c629
RDX: 0000000000000704 RSI: 0000000000000000 RDI: 0000200000000000
RBP: 00007fd8101e2b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd8103c6128 R14: 00007fd8103c6090 R15: 00007ffce8b234e8
</TASK>