ocfs2: Mounting device (7,1) on (node local, slot 0) with ordered data mode. ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.1.103/4882 is trying to acquire lock: ffff88804d4ec2c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] ffff88804d4ec2c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: ocfs2_reserve_local_alloc_bits+0x11e/0x2770 fs/ocfs2/localalloc.c:635 but task is already holding lock: ffff88804d4e5be0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_lock_global_qf+0x1fe/0x290 fs/ocfs2/quota_global.c:314 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #7 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}: down_write+0x36/0x60 kernel/locking/rwsem.c:1573 ocfs2_lock_global_qf+0x1fe/0x290 fs/ocfs2/quota_global.c:314 ocfs2_acquire_dquot+0x2b8/0xb80 fs/ocfs2/quota_global.c:816 dqget+0x713/0xbb0 fs/quota/dquot.c:1010 ocfs2_setattr+0x1025/0x1d90 fs/ocfs2/file.c:1233 notify_change+0xca0/0xf90 fs/attr.c:499 chown_common+0x489/0x640 fs/open.c:736 vfs_fchown fs/open.c:804 [inline] ksys_fchown+0xe2/0x150 fs/open.c:815 __do_sys_fchown fs/open.c:823 [inline] __se_sys_fchown fs/open.c:821 [inline] __x64_sys_fchown+0x76/0x80 fs/open.c:821 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #6 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7){+.+.}-{3:3}: down_write+0x36/0x60 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] ocfs2_lock_global_qf+0x1d7/0x290 fs/ocfs2/quota_global.c:313 ocfs2_acquire_dquot+0x2b8/0xb80 fs/ocfs2/quota_global.c:816 dqget+0x713/0xbb0 fs/quota/dquot.c:1010 ocfs2_setattr+0x1025/0x1d90 fs/ocfs2/file.c:1233 notify_change+0xca0/0xf90 fs/attr.c:499 chown_common+0x489/0x640 fs/open.c:736 vfs_fchown fs/open.c:804 [inline] ksys_fchown+0xe2/0x150 fs/open.c:815 __do_sys_fchown fs/open.c:823 [inline] __se_sys_fchown fs/open.c:821 [inline] __x64_sys_fchown+0x76/0x80 fs/open.c:821 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #5 (&dquot->dq_lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12d/0xae0 kernel/locking/mutex.c:747 dquot_commit+0x5a/0x410 fs/quota/dquot.c:532 ext4_write_dquot+0x1f0/0x360 fs/ext4/super.c:6817 mark_dquot_dirty fs/quota/dquot.c:397 [inline] mark_all_dquot_dirty+0xf9/0x400 fs/quota/dquot.c:437 __dquot_alloc_space+0x5f6/0xe50 fs/quota/dquot.c:1774 dquot_alloc_space_nodirty include/linux/quotaops.h:293 [inline] dquot_alloc_space include/linux/quotaops.h:306 [inline] dquot_alloc_block include/linux/quotaops.h:330 [inline] ext4_mb_new_blocks+0xf55/0x44d0 fs/ext4/mballoc.c:5740 ext4_ext_map_blocks+0x18d1/0x6640 fs/ext4/extents.c:4361 ext4_map_blocks+0x9d7/0x1a90 fs/ext4/inode.c:681 _ext4_get_block+0x1e7/0x540 fs/ext4/inode.c:824 ext4_get_block_unwritten+0x2a/0x100 fs/ext4/inode.c:857 ext4_block_write_begin+0x63b/0x12f0 fs/ext4/inode.c:1126 ext4_write_begin+0x623/0xf40 fs/ext4/ext4_jbd2.h:-1 ext4_da_write_begin+0x408/0x920 fs/ext4/inode.c:3002 pagecache_write+0x20a/0x380 fs/ext4/verity.c:85 build_merkle_tree_level fs/verity/enable.c:121 [inline] build_merkle_tree fs/verity/enable.c:182 [inline] enable_verity+0x114b/0x1f70 fs/verity/enable.c:268 fsverity_ioctl_enable+0x40c/0x4b0 fs/verity/enable.c:392 __ext4_ioctl fs/ext4/ioctl.c:1583 [inline] ext4_ioctl+0x1aab/0x4140 fs/ext4/ioctl.c:1617 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #4 (&ei->i_data_sem){++++}-{3:3}: down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520 ext4_map_blocks+0x338/0x1a90 fs/ext4/inode.c:606 ext4_append+0x22d/0x560 fs/ext4/namei.c:75 ext4_init_new_dir+0x2b8/0x550 fs/ext4/namei.c:3030 ext4_mkdir+0x4c3/0xc90 fs/ext4/namei.c:3076 vfs_mkdir+0x386/0x570 fs/namei.c:4114 do_mkdirat+0x1d8/0x440 fs/namei.c:4139 __do_sys_mkdir fs/namei.c:4159 [inline] __se_sys_mkdir fs/namei.c:4157 [inline] __x64_sys_mkdir+0x6a/0x80 fs/namei.c:4157 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #3 (jbd2_handle){++++}-{0:0}: wait_transaction_locked+0x1bf/0x270 fs/jbd2/transaction.c:177 add_transaction_credits fs/jbd2/transaction.c:241 [inline] start_this_handle+0x7e7/0x2240 fs/jbd2/transaction.c:422 jbd2__journal_start+0x2b7/0x5a0 fs/jbd2/transaction.c:520 jbd2_journal_start+0x26/0x30 fs/jbd2/transaction.c:559 ocfs2_start_trans+0x3b0/0x6f0 fs/ocfs2/journal.c:376 ocfs2_del_inode_from_orphan+0x169/0x7b0 fs/ocfs2/namei.c:2722 ocfs2_dio_end_io_write fs/ocfs2/aops.c:2407 [inline] ocfs2_dio_end_io+0x1074/0x13f0 fs/ocfs2/aops.c:2446 dio_complete+0x249/0x710 fs/direct-io.c:271 __blockdev_direct_IO+0x2e15/0x34c0 fs/direct-io.c:1320 ocfs2_direct_IO+0x233/0x2a0 fs/ocfs2/aops.c:2483 generic_file_direct_write+0x112/0x330 mm/filemap.c:3787 __generic_file_write_iter+0x15f/0x2a0 mm/filemap.c:3945 ocfs2_file_write_iter+0x1731/0x1fc0 fs/ocfs2/file.c:2469 do_iter_readv_writev fs/read_write.c:-1 [inline] do_iter_write+0x638/0xb10 fs/read_write.c:861 iter_file_splice_write+0x6be/0xcf0 fs/splice.c:685 do_splice_from fs/splice.c:763 [inline] direct_splice_actor+0xe1/0x130 fs/splice.c:950 splice_direct_to_actor+0x4b8/0xbd0 fs/splice.c:896 do_splice_direct+0x1ce/0x2f0 fs/splice.c:1002 do_sendfile+0x51b/0xe20 fs/read_write.c:1255 __do_sys_sendfile64 fs/read_write.c:1323 [inline] __se_sys_sendfile64+0x141/0x1a0 fs/read_write.c:1309 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #2 (&journal->j_trans_barrier){.+.+}-{3:3}: down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520 ocfs2_start_trans+0x3a4/0x6f0 fs/ocfs2/journal.c:374 ocfs2_mknod+0x1273/0x2580 fs/ocfs2/namei.c:361 ocfs2_create+0x1b6/0x4b0 fs/ocfs2/namei.c:674 lookup_open fs/namei.c:3490 [inline] open_last_lookups fs/namei.c:3558 [inline] path_openat+0x11b9/0x2f10 fs/namei.c:3788 do_filp_open+0x1ee/0x420 fs/namei.c:3818 do_sys_openat2+0x14b/0x4f0 fs/open.c:1320 do_sys_open fs/open.c:1336 [inline] __do_sys_openat fs/open.c:1352 [inline] __se_sys_openat fs/open.c:1347 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1347 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #1 (sb_internal#5){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1891 [inline] sb_start_intwrite include/linux/fs.h:2013 [inline] ocfs2_start_trans+0x2a5/0x6f0 fs/ocfs2/journal.c:372 ocfs2_mknod+0x1273/0x2580 fs/ocfs2/namei.c:361 ocfs2_create+0x1b6/0x4b0 fs/ocfs2/namei.c:674 lookup_open fs/namei.c:3490 [inline] open_last_lookups fs/namei.c:3558 [inline] path_openat+0x11b9/0x2f10 fs/namei.c:3788 do_filp_open+0x1ee/0x420 fs/namei.c:3818 do_sys_openat2+0x14b/0x4f0 fs/open.c:1320 do_sys_open fs/open.c:1336 [inline] __do_sys_openat fs/open.c:1352 [inline] __se_sys_openat fs/open.c:1347 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1347 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x2c92/0x7bd0 kernel/locking/lockdep.c:5049 lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5662 down_write+0x36/0x60 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] ocfs2_reserve_local_alloc_bits+0x11e/0x2770 fs/ocfs2/localalloc.c:635 ocfs2_reserve_clusters_with_limit+0x1b6/0xc10 fs/ocfs2/suballoc.c:1162 ocfs2_reserve_clusters fs/ocfs2/suballoc.c:1223 [inline] ocfs2_lock_allocators+0x2ce/0x5f0 fs/ocfs2/suballoc.c:2679 ocfs2_extend_allocation+0x3fe/0x1940 fs/ocfs2/file.c:585 ocfs2_extend_no_holes+0x206/0x4b0 fs/ocfs2/file.c:1027 ocfs2_acquire_dquot+0x60f/0xb80 fs/ocfs2/quota_global.c:841 dqget+0x713/0xbb0 fs/quota/dquot.c:1010 ocfs2_setattr+0x1025/0x1d90 fs/ocfs2/file.c:1233 notify_change+0xca0/0xf90 fs/attr.c:499 chown_common+0x489/0x640 fs/open.c:736 vfs_fchown fs/open.c:804 [inline] ksys_fchown+0xe2/0x150 fs/open.c:815 __do_sys_fchown fs/open.c:823 [inline] __se_sys_fchown fs/open.c:821 [inline] __x64_sys_fchown+0x76/0x80 fs/open.c:821 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Chain exists of: &ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4 --> &ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7 --> &ocfs2_quota_ip_alloc_sem_key Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ocfs2_quota_ip_alloc_sem_key); lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7); lock(&ocfs2_quota_ip_alloc_sem_key); lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4); *** DEADLOCK *** 5 locks held by syz.1.103/4882: #0: ffff888074cce460 (sb_writers#21){.+.+}-{0:0}, at: mnt_want_write_file+0x5c/0x200 fs/namespace.c:446 #1: ffff88804d4e09c8 (&type->i_mutex_dir_key#14){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff88804d4e09c8 (&type->i_mutex_dir_key#14){+.+.}-{3:3}, at: chown_common+0x322/0x640 fs/open.c:726 #2: ffff88804d44c0a8 (&dquot->dq_lock){+.+.}-{3:3}, at: ocfs2_acquire_dquot+0x2ab/0xb80 fs/ocfs2/quota_global.c:811 #3: ffff88804d4e5f48 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #3: ffff88804d4e5f48 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7){+.+.}-{3:3}, at: ocfs2_lock_global_qf+0x1d7/0x290 fs/ocfs2/quota_global.c:313 #4: ffff88804d4e5be0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_lock_global_qf+0x1fe/0x290 fs/ocfs2/quota_global.c:314 stack backtrace: CPU: 0 PID: 4882 Comm: syz.1.103 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026 Call Trace: dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106 check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x2c92/0x7bd0 kernel/locking/lockdep.c:5049 lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5662 down_write+0x36/0x60 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] ocfs2_reserve_local_alloc_bits+0x11e/0x2770 fs/ocfs2/localalloc.c:635 ocfs2_reserve_clusters_with_limit+0x1b6/0xc10 fs/ocfs2/suballoc.c:1162 ocfs2_reserve_clusters fs/ocfs2/suballoc.c:1223 [inline] ocfs2_lock_allocators+0x2ce/0x5f0 fs/ocfs2/suballoc.c:2679 ocfs2_extend_allocation+0x3fe/0x1940 fs/ocfs2/file.c:585 ocfs2_extend_no_holes+0x206/0x4b0 fs/ocfs2/file.c:1027 ocfs2_acquire_dquot+0x60f/0xb80 fs/ocfs2/quota_global.c:841 dqget+0x713/0xbb0 fs/quota/dquot.c:1010 ocfs2_setattr+0x1025/0x1d90 fs/ocfs2/file.c:1233 notify_change+0xca0/0xf90 fs/attr.c:499 chown_common+0x489/0x640 fs/open.c:736 vfs_fchown fs/open.c:804 [inline] ksys_fchown+0xe2/0x150 fs/open.c:815 __do_sys_fchown fs/open.c:823 [inline] __se_sys_fchown fs/open.c:821 [inline] __x64_sys_fchown+0x76/0x80 fs/open.c:821 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f841379ce59 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:00007f8414622028 EFLAGS: 00000246 ORIG_RAX: 000000000000005d RAX: ffffffffffffffda RBX: 00007f8413a15fa0 RCX: 00007f841379ce59 RDX: 0000000080fe000a RSI: 000000003a736e6f RDI: 0000000000000004 RBP: 00007f8413832e6f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f8413a16038 R14: 00007f8413a15fa0 R15: 00007ffccd509ab8