WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.2.21/5900 is trying to acquire lock: ffff8880765e79a0 (&ocfs2_sysfile_lock_key[EXTENT_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1024 [inline] ffff8880765e79a0 (&ocfs2_sysfile_lock_key[EXTENT_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_reserve_suballoc_bits+0x170/0x4850 fs/ocfs2/suballoc.c:904 but task is already holding lock: ffff88805584da58 (&oi->ip_alloc_sem/1){+.+.}-{4:4}, at: ocfs2_remap_file_range+0x33c/0x6f0 fs/ocfs2/file.c:2744 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (&oi->ip_alloc_sem/1){+.+.}-{4:4}: down_write_nested+0x98/0x200 kernel/locking/rwsem.c:1757 ocfs2_xattr_set_handle+0x3fc/0x820 fs/ocfs2/xattr.c:3870 ocfs2_set_acl+0x6d1/0x7b0 fs/ocfs2/acl.c:250 ocfs2_init_acl+0x1fe/0x420 fs/ocfs2/acl.c:428 ocfs2_mknod+0x1383/0x2190 fs/ocfs2/namei.c:413 ocfs2_mkdir+0x180/0x430 fs/ocfs2/namei.c:661 vfs_mkdir+0x40e/0x630 fs/namei.c:5452 filename_mkdirat+0x285/0x510 fs/namei.c:5485 __do_sys_mkdirat fs/namei.c:5506 [inline] __se_sys_mkdirat+0x35/0x150 fs/namei.c:5503 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #3 (&journal->j_trans_barrier){.+.+}-{4:4}: down_read+0x45/0x320 kernel/locking/rwsem.c:1574 ocfs2_start_trans+0x3a9/0x6f0 fs/ocfs2/journal.c:370 ocfs2_modify_bh+0xe3/0x4c0 fs/ocfs2/quota_local.c:101 ocfs2_local_read_info+0xe32/0x1370 fs/ocfs2/quota_local.c:795 dquot_load_quota_sb+0x76f/0xb70 fs/quota/dquot.c:2432 dquot_load_quota_inode+0x2dc/0x5d0 fs/quota/dquot.c:2469 ocfs2_enable_quotas+0x1c3/0x4a0 fs/ocfs2/super.c:930 ocfs2_fill_super+0x5498/0x6a20 fs/ocfs2/super.c:1140 get_tree_bdev_flags+0x430/0x4f0 fs/super.c:1883 vfs_get_tree+0x92/0x2a0 fs/super.c:1943 fc_mount fs/namespace.c:1278 [inline] do_new_mount_fc fs/namespace.c:3885 [inline] do_new_mount+0x325/0xb00 fs/namespace.c:3961 do_mount fs/namespace.c:4325 [inline] __do_sys_mount fs/namespace.c:4540 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4517 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (sb_internal#2){.+.+}-{0:0}: percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline] percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline] __sb_start_write include/linux/fs/super.h:19 [inline] sb_start_intwrite include/linux/fs/super.h:177 [inline] ocfs2_start_trans+0x2a7/0x6f0 fs/ocfs2/journal.c:368 ocfs2_block_group_alloc fs/ocfs2/suballoc.c:801 [inline] ocfs2_reserve_suballoc_bits+0x7b7/0x4850 fs/ocfs2/suballoc.c:950 ocfs2_reserve_new_metadata_blocks+0x415/0x9a0 fs/ocfs2/suballoc.c:1100 ocfs2_init_xattr_set_ctxt+0x2f5/0x760 fs/ocfs2/xattr.c:3629 ocfs2_xattr_set+0xd2b/0x13f0 fs/ocfs2/xattr.c:4012 ocfs2_set_acl+0x6fd/0x7b0 fs/ocfs2/acl.c:254 ocfs2_iop_set_acl+0x1b1/0x2b0 fs/ocfs2/acl.c:286 set_posix_acl fs/posix_acl.c:960 [inline] vfs_set_acl+0x8a0/0xb50 fs/posix_acl.c:1139 do_set_acl+0xf0/0x180 fs/posix_acl.c:1284 do_setxattr fs/xattr.c:659 [inline] filename_setxattr+0x305/0x630 fs/xattr.c:690 path_setxattrat+0x408/0x450 fs/xattr.c:734 __do_sys_lsetxattr fs/xattr.c:775 [inline] __se_sys_lsetxattr fs/xattr.c:771 [inline] __x64_sys_lsetxattr+0xbf/0xe0 fs/xattr.c:771 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&ocfs2_sysfile_lock_key[GLOBAL_BITMAP_SYSTEM_INODE]){+.+.}-{4:4}: down_write+0x91/0x200 kernel/locking/rwsem.c:1631 inode_lock include/linux/fs.h:1024 [inline] ocfs2_reserve_suballoc_bits+0x170/0x4850 fs/ocfs2/suballoc.c:904 ocfs2_reserve_cluster_bitmap_bits fs/ocfs2/suballoc.c:1250 [inline] ocfs2_reserve_clusters_with_limit+0x3bc/0xc20 fs/ocfs2/suballoc.c:1295 ocfs2_block_group_alloc fs/ocfs2/suballoc.c:790 [inline] ocfs2_reserve_suballoc_bits+0x797/0x4850 fs/ocfs2/suballoc.c:950 ocfs2_reserve_new_metadata_blocks+0x415/0x9a0 fs/ocfs2/suballoc.c:1100 ocfs2_init_xattr_set_ctxt+0x2f5/0x760 fs/ocfs2/xattr.c:3629 ocfs2_xattr_set+0xd2b/0x13f0 fs/ocfs2/xattr.c:4012 ocfs2_set_acl+0x6fd/0x7b0 fs/ocfs2/acl.c:254 ocfs2_iop_set_acl+0x1b1/0x2b0 fs/ocfs2/acl.c:286 set_posix_acl fs/posix_acl.c:960 [inline] vfs_set_acl+0x8a0/0xb50 fs/posix_acl.c:1139 do_set_acl+0xf0/0x180 fs/posix_acl.c:1284 do_setxattr fs/xattr.c:659 [inline] filename_setxattr+0x305/0x630 fs/xattr.c:690 path_setxattrat+0x408/0x450 fs/xattr.c:734 __do_sys_lsetxattr fs/xattr.c:775 [inline] __se_sys_lsetxattr fs/xattr.c:771 [inline] __x64_sys_lsetxattr+0xbf/0xe0 fs/xattr.c:771 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&ocfs2_sysfile_lock_key[EXTENT_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3209 [inline] check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x164c/0x2de0 kernel/locking/lockdep.c:5288 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942 down_write+0x91/0x200 kernel/locking/rwsem.c:1631 inode_lock include/linux/fs.h:1024 [inline] ocfs2_reserve_suballoc_bits+0x170/0x4850 fs/ocfs2/suballoc.c:904 ocfs2_reserve_new_metadata_blocks+0x415/0x9a0 fs/ocfs2/suballoc.c:1100 ocfs2_create_refcount_tree+0x27c/0x1310 fs/ocfs2/refcounttree.c:625 ocfs2_reflink_remap_blocks+0x316/0x1ab0 fs/ocfs2/refcounttree.c:4702 ocfs2_remap_file_range+0x451/0x6f0 fs/ocfs2/file.c:2752 vfs_copy_file_range+0xd70/0x1340 fs/read_write.c:1599 __do_sys_copy_file_range fs/read_write.c:1682 [inline] __se_sys_copy_file_range+0x2fb/0x480 fs/read_write.c:1649 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &ocfs2_sysfile_lock_key[EXTENT_ALLOC_SYSTEM_INODE] --> &journal->j_trans_barrier --> &oi->ip_alloc_sem/1 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&oi->ip_alloc_sem/1); lock(&journal->j_trans_barrier); lock(&oi->ip_alloc_sem/1); lock(&ocfs2_sysfile_lock_key[EXTENT_ALLOC_SYSTEM_INODE]); *** DEADLOCK *** locks held by syz.2.21/5900: 5, last CPU#1: #0: ffff88804f05c460 (sb_writers#12){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2756 [inline] #0: ffff88804f05c460 (sb_writers#12){.+.+}-{0:0}, at: vfs_copy_file_range+0x98a/0x1340 fs/read_write.c:1587 #1: ffff88805584cfa0 (&sb->s_type->i_mutex_key#25){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1024 [inline] #1: ffff88805584cfa0 (&sb->s_type->i_mutex_key#25){+.+.}-{4:4}, at: lock_two_nondirectories+0xe7/0x180 fs/inode.c:1254 #2: ffff88805584dda0 (&sb->s_type->i_mutex_key#25/4){+.+.}-{4:4}, at: ocfs2_reflink_inodes_lock+0x11a/0xc20 fs/ocfs2/refcounttree.c:4769 #3: ffff88805584cc58 (&oi->ip_alloc_sem#2){++++}-{4:4}, at: ocfs2_remap_file_range+0x318/0x6f0 fs/ocfs2/file.c:2742 #4: ffff88805584da58 (&oi->ip_alloc_sem/1){+.+.}-{4:4}, at: ocfs2_remap_file_range+0x33c/0x6f0 fs/ocfs2/file.c:2744 stack backtrace: CPU: 1 UID: 0 PID: 5900 Comm: syz.2.21 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_circular_bug+0x2e2/0x300 kernel/locking/lockdep.c:2087 check_noncircular+0x12f/0x150 kernel/locking/lockdep.c:2219 check_prev_add kernel/locking/lockdep.c:3209 [inline] check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x164c/0x2de0 kernel/locking/lockdep.c:5288 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942 down_write+0x91/0x200 kernel/locking/rwsem.c:1631 inode_lock include/linux/fs.h:1024 [inline] ocfs2_reserve_suballoc_bits+0x170/0x4850 fs/ocfs2/suballoc.c:904 ocfs2_reserve_new_metadata_blocks+0x415/0x9a0 fs/ocfs2/suballoc.c:1100 ocfs2_create_refcount_tree+0x27c/0x1310 fs/ocfs2/refcounttree.c:625 ocfs2_reflink_remap_blocks+0x316/0x1ab0 fs/ocfs2/refcounttree.c:4702 ocfs2_remap_file_range+0x451/0x6f0 fs/ocfs2/file.c:2752 vfs_copy_file_range+0xd70/0x1340 fs/read_write.c:1599 __do_sys_copy_file_range fs/read_write.c:1682 [inline] __se_sys_copy_file_range+0x2fb/0x480 fs/read_write.c:1649 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f352779e1d9 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:00007f3528673028 EFLAGS: 00000246 ORIG_RAX: 0000000000000146 RAX: ffffffffffffffda RBX: 00007f3527a26180 RCX: 00007f352779e1d9 RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000000000009 RBP: 00007f3527835888 R08: 0000020000000008 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f3527a26218 R14: 00007f3527a26180 R15: 00007ffe49dac9b8 kcov: kcov_task_exit: t = ffff88802fe50000, kcov->t = ffff88802fe50000