ocfs2: Mounting device (7,0) on (node local, slot 0) with ordered data mode. ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.0.653/12576 is trying to acquire lock: ffff8880482507d0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{4:4}, at: ocfs2_lock_global_qf+0x1e8/0x270 fs/ocfs2/quota_global.c:314 but task is already holding lock: ffff888048250b80 (&ocfs2_sysfile_lock_key[GROUP_QUOTA_SYSTEM_INODE]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1027 [inline] ffff888048250b80 (&ocfs2_sysfile_lock_key[GROUP_QUOTA_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_lock_global_qf+0x1ca/0x270 fs/ocfs2/quota_global.c:313 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #6 (&ocfs2_sysfile_lock_key[GROUP_QUOTA_SYSTEM_INODE]){+.+.}-{4:4}: down_write+0x3a/0x50 kernel/locking/rwsem.c:1590 inode_lock include/linux/fs.h:1027 [inline] ocfs2_lock_global_qf+0x1ca/0x270 fs/ocfs2/quota_global.c:313 ocfs2_acquire_dquot+0x2a0/0xb10 fs/ocfs2/quota_global.c:828 dqget+0x7b6/0xf10 fs/quota/dquot.c:980 ocfs2_setattr+0xf58/0x1b20 fs/ocfs2/file.c:1243 notify_change+0xc18/0xf60 fs/attr.c:546 chown_common+0x40c/0x5c0 fs/open.c:788 vfs_fchown fs/open.c:856 [inline] ksys_fchown+0xea/0x160 fs/open.c:868 __do_sys_fchown fs/open.c:873 [inline] __se_sys_fchown fs/open.c:871 [inline] __x64_sys_fchown+0x7a/0x90 fs/open.c:871 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #5 (&dquot->dq_lock){+.+.}-{4:4}: __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_transfer+0x2f8/0x6d0 fs/quota/dquot.c:2143 ext4_setattr+0x865/0x1bc0 fs/ext4/inode.c:5877 notify_change+0xc18/0xf60 fs/attr.c:546 chown_common+0x40c/0x5c0 fs/open.c:788 do_fchownat+0x161/0x270 fs/open.c:819 __do_sys_lchown fs/open.c:844 [inline] __se_sys_lchown fs/open.c:842 [inline] __x64_sys_lchown+0x85/0xa0 fs/open.c:842 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #4 (&ei->xattr_sem){++++}-{4:4}: down_write+0x3a/0x50 kernel/locking/rwsem.c:1590 ext4_write_lock_xattr fs/ext4/xattr.h:157 [inline] ext4_xattr_set_handle+0x165/0x1590 fs/ext4/xattr.c:2367 ext4_initxattrs+0x9f/0x110 fs/ext4/xattr_security.c:44 security_inode_init_security+0x2a0/0x3f0 security/security.c:1891 __ext4_new_inode+0x32f7/0x3c90 fs/ext4/ialloc.c:1325 ext4_create+0x22d/0x460 fs/ext4/namei.c:2822 lookup_open fs/namei.c:4440 [inline] open_last_lookups fs/namei.c:4540 [inline] path_openat+0x18d1/0x3df0 fs/namei.c:4784 do_filp_open+0x1fa/0x410 fs/namei.c:4814 do_sys_openat2+0x121/0x200 fs/open.c:1430 do_sys_open fs/open.c:1436 [inline] __do_sys_openat fs/open.c:1452 [inline] __se_sys_openat fs/open.c:1447 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1447 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #3 (jbd2_handle){++++}-{0:0}: start_this_handle+0x1fa7/0x21c0 fs/jbd2/transaction.c:444 jbd2__journal_start+0x2c1/0x5b0 fs/jbd2/transaction.c:501 jbd2_journal_start+0x2a/0x40 fs/jbd2/transaction.c:540 ocfs2_start_trans+0x377/0x6d0 fs/ocfs2/journal.c:374 ocfs2_shutdown_local_alloc+0x200/0xa10 fs/ocfs2/localalloc.c:417 ocfs2_dismount_volume+0x1e9/0x8b0 fs/ocfs2/super.c:1825 generic_shutdown_super+0x135/0x2c0 fs/super.c:643 kill_block_super+0x44/0x90 fs/super.c:1730 deactivate_locked_super+0xbc/0x130 fs/super.c:474 cleanup_mnt+0x425/0x4c0 fs/namespace.c:1318 task_work_run+0x1d4/0x260 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop+0xe9/0x130 kernel/entry/common.c:43 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline] do_syscall_64+0x2c7/0xf80 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (&journal->j_trans_barrier){.+.+}-{4:4}: down_read+0x97/0x1f0 kernel/locking/rwsem.c:1537 ocfs2_start_trans+0x36b/0x6d0 fs/ocfs2/journal.c:372 ocfs2_shutdown_local_alloc+0x200/0xa10 fs/ocfs2/localalloc.c:417 ocfs2_dismount_volume+0x1e9/0x8b0 fs/ocfs2/super.c:1825 generic_shutdown_super+0x135/0x2c0 fs/super.c:643 kill_block_super+0x44/0x90 fs/super.c:1730 deactivate_locked_super+0xbc/0x130 fs/super.c:474 cleanup_mnt+0x425/0x4c0 fs/namespace.c:1318 task_work_run+0x1d4/0x260 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop+0xe9/0x130 kernel/entry/common.c:43 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline] do_syscall_64+0x2c7/0xf80 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (sb_internal#4){.+.+}-{0:0}: __lock_release kernel/locking/lockdep.c:5574 [inline] lock_release+0x1ab/0x3b0 kernel/locking/lockdep.c:5889 up_write+0x1a/0x60 kernel/locking/rwsem.c:1642 inode_unlock include/linux/fs.h:1037 [inline] ocfs2_free_ac_resource fs/ocfs2/suballoc.c:130 [inline] ocfs2_free_alloc_context+0x97/0x1a0 fs/ocfs2/suballoc.c:144 ocfs2_write_begin_nolock+0x4256/0x4300 fs/ocfs2/aops.c:1804 ocfs2_dio_wr_get_block+0xb6f/0x1770 fs/ocfs2/aops.c:2214 get_more_blocks fs/direct-io.c:648 [inline] do_direct_IO fs/direct-io.c:936 [inline] __blockdev_direct_IO+0x157c/0x31f0 fs/direct-io.c:1243 ocfs2_direct_IO+0x260/0x2d0 fs/ocfs2/aops.c:2441 generic_file_direct_write+0x1dc/0x3e0 mm/filemap.c:4234 __generic_file_write_iter+0x120/0x240 mm/filemap.c:4403 ocfs2_file_write_iter+0x1585/0x1d00 fs/ocfs2/file.c:2469 iter_file_splice_write+0x977/0x10b0 fs/splice.c:738 do_splice_from fs/splice.c:938 [inline] direct_splice_actor+0x104/0x160 fs/splice.c:1161 splice_direct_to_actor+0x5b3/0xcd0 fs/splice.c:1105 do_splice_direct_actor fs/splice.c:1204 [inline] do_splice_direct+0x187/0x270 fs/splice.c:1230 do_sendfile+0x4ec/0x7f0 fs/read_write.c:1370 __do_sys_sendfile64 fs/read_write.c:1431 [inline] __se_sys_sendfile64+0x13e/0x190 fs/read_write.c:1417 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xf80 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:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x15a6/0x2cf0 kernel/locking/lockdep.c:5237 lock_acquire+0x117/0x340 kernel/locking/lockdep.c:5868 down_write+0x3a/0x50 kernel/locking/rwsem.c:1590 ocfs2_lock_global_qf+0x1e8/0x270 fs/ocfs2/quota_global.c:314 ocfs2_acquire_dquot+0x2a0/0xb10 fs/ocfs2/quota_global.c:828 dqget+0x7b6/0xf10 fs/quota/dquot.c:980 ocfs2_setattr+0xf58/0x1b20 fs/ocfs2/file.c:1243 notify_change+0xc18/0xf60 fs/attr.c:546 chown_common+0x40c/0x5c0 fs/open.c:788 vfs_fchown fs/open.c:856 [inline] ksys_fchown+0xea/0x160 fs/open.c:868 __do_sys_fchown fs/open.c:873 [inline] __se_sys_fchown fs/open.c:871 [inline] __x64_sys_fchown+0x7a/0x90 fs/open.c:871 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/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: &ocfs2_quota_ip_alloc_sem_key --> &dquot->dq_lock --> &ocfs2_sysfile_lock_key[GROUP_QUOTA_SYSTEM_INODE] Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ocfs2_sysfile_lock_key[GROUP_QUOTA_SYSTEM_INODE]); lock(&dquot->dq_lock); lock(&ocfs2_sysfile_lock_key[GROUP_QUOTA_SYSTEM_INODE]); lock(&ocfs2_quota_ip_alloc_sem_key); *** DEADLOCK *** 4 locks held by syz.0.653/12576: #0: ffff88803763a480 (sb_writers#20){.+.+}-{0:0}, at: mnt_want_write_file+0x63/0x210 fs/namespace.c:543 #1: ffff888048261c40 (&type->i_mutex_dir_key#17){++++}-{4:4}, at: inode_lock_killable include/linux/fs.h:1032 [inline] #1: ffff888048261c40 (&type->i_mutex_dir_key#17){++++}-{4:4}, at: chown_common+0x313/0x5c0 fs/open.c:776 #2: ffff88806604c098 (&dquot->dq_lock){+.+.}-{4:4}, at: ocfs2_acquire_dquot+0x293/0xb10 fs/ocfs2/quota_global.c:823 #3: ffff888048250b80 (&ocfs2_sysfile_lock_key[GROUP_QUOTA_SYSTEM_INODE]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1027 [inline] #3: ffff888048250b80 (&ocfs2_sysfile_lock_key[GROUP_QUOTA_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_lock_global_qf+0x1ca/0x270 fs/ocfs2/quota_global.c:313 stack backtrace: CPU: 1 UID: 0 PID: 12576 Comm: syz.0.653 Not tainted syzkaller #0 PREEMPT_{RT,(full)} Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_circular_bug+0x2e2/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+0x15a6/0x2cf0 kernel/locking/lockdep.c:5237 lock_acquire+0x117/0x340 kernel/locking/lockdep.c:5868 down_write+0x3a/0x50 kernel/locking/rwsem.c:1590 ocfs2_lock_global_qf+0x1e8/0x270 fs/ocfs2/quota_global.c:314 ocfs2_acquire_dquot+0x2a0/0xb10 fs/ocfs2/quota_global.c:828 dqget+0x7b6/0xf10 fs/quota/dquot.c:980 ocfs2_setattr+0xf58/0x1b20 fs/ocfs2/file.c:1243 notify_change+0xc18/0xf60 fs/attr.c:546 chown_common+0x40c/0x5c0 fs/open.c:788 vfs_fchown fs/open.c:856 [inline] ksys_fchown+0xea/0x160 fs/open.c:868 __do_sys_fchown fs/open.c:873 [inline] __se_sys_fchown fs/open.c:871 [inline] __x64_sys_fchown+0x7a/0x90 fs/open.c:871 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f2ea357f749 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:00007f2ea17de038 EFLAGS: 00000246 ORIG_RAX: 000000000000005d RAX: ffffffffffffffda RBX: 00007f2ea37d5fa0 RCX: 00007f2ea357f749 RDX: 000000000000ee01 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00007f2ea3603f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f2ea37d6038 R14: 00007f2ea37d5fa0 R15: 00007fffa30dfc48