====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.3.1092/8601 is trying to acquire lock: ffff8880706e94a0 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_reflink+0x4cb/0x920 fs/ocfs2/refcounttree.c:4304 but task is already holding lock: ffff8880706e9538 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_reflink+0x4bc/0x920 fs/ocfs2/refcounttree.c:4303 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&oi->ip_xattr_sem){++++}-{3:3}: down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498 ocfs2_init_acl+0x307/0x770 fs/ocfs2/acl.c:365 ocfs2_mknod+0x15de/0x2510 fs/ocfs2/namei.c:410 ocfs2_create+0x192/0x420 fs/ocfs2/namei.c:674 lookup_open fs/namei.c:3470 [inline] open_last_lookups fs/namei.c:3540 [inline] path_openat+0x120a/0x2fb0 fs/namei.c:3747 do_filp_open+0x1df/0x400 fs/namei.c:3777 do_sys_openat2+0x14b/0x500 fs/open.c:1255 do_sys_open fs/open.c:1271 [inline] __do_sys_openat fs/open.c:1287 [inline] __se_sys_openat fs/open.c:1282 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1282 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 -> #2 (&journal->j_trans_barrier){.+.+}-{3:3}: down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498 ocfs2_start_trans+0x3a6/0x6f0 fs/ocfs2/journal.c:374 ocfs2_modify_bh+0xe0/0x4c0 fs/ocfs2/quota_local.c:101 ocfs2_local_read_info+0x1499/0x1820 fs/ocfs2/quota_local.c:764 dquot_load_quota_sb+0x72f/0xa80 fs/quota/dquot.c:2485 dquot_load_quota_inode+0x2d3/0x5c0 fs/quota/dquot.c:2522 ocfs2_enable_quotas+0x1c0/0x4a0 fs/ocfs2/super.c:927 ocfs2_fill_super+0x3c84/0x50a0 fs/ocfs2/super.c:1140 mount_bdev+0x28a/0x3c0 fs/super.c:1400 legacy_get_tree+0xe6/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1530 do_new_mount+0x247/0xa40 fs/namespace.c:3034 do_mount fs/namespace.c:3377 [inline] __do_sys_mount fs/namespace.c:3585 [inline] __se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3562 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 (sb_internal#5){.+.+}-{0:0}: __lock_release kernel/locking/lockdep.c:5339 [inline] lock_release+0x321/0x8a0 kernel/locking/lockdep.c:5643 up_write+0x29/0x410 kernel/locking/rwsem.c:1603 inode_unlock include/linux/fs.h:792 [inline] ocfs2_free_ac_resource fs/ocfs2/suballoc.c:126 [inline] ocfs2_free_alloc_context+0x93/0x1a0 fs/ocfs2/suballoc.c:140 ocfs2_write_begin_nolock+0x441b/0x44b0 fs/ocfs2/aops.c:1828 ocfs2_write_begin+0x1b4/0x310 fs/ocfs2/aops.c:1907 generic_perform_write+0x2b6/0x550 mm/filemap.c:3785 __generic_file_write_iter+0x261/0x4e0 mm/filemap.c:3912 ocfs2_file_write_iter+0x171a/0x1ee0 fs/ocfs2/file.c:2472 call_write_iter include/linux/fs.h:2173 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x748/0xd70 fs/read_write.c:594 ksys_write+0x153/0x260 fs/read_write.c:647 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 (&ocfs2_file_ip_alloc_sem_key){++++}-{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+0x2c66/0x7b50 kernel/locking/lockdep.c:5012 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623 down_write+0x38/0x60 kernel/locking/rwsem.c:1551 ocfs2_reflink+0x4cb/0x920 fs/ocfs2/refcounttree.c:4304 ocfs2_vfs_reflink+0x333/0x450 fs/ocfs2/refcounttree.c:4431 ocfs2_reflink_ioctl+0x39c/0x440 fs/ocfs2/refcounttree.c:4471 ocfs2_ioctl+0x586/0x7a0 fs/ocfs2/ioctl.c:913 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860 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: &ocfs2_file_ip_alloc_sem_key --> &journal->j_trans_barrier --> &oi->ip_xattr_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&oi->ip_xattr_sem); lock(&journal->j_trans_barrier); lock(&oi->ip_xattr_sem); lock(&ocfs2_file_ip_alloc_sem_key); *** DEADLOCK *** 4 locks held by syz.3.1092/8601: #0: ffff888054e2c460 (sb_writers#31){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:386 #1: ffff88805e7f6d88 (&type->i_mutex_dir_key#24/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:822 [inline] #1: ffff88805e7f6d88 (&type->i_mutex_dir_key#24/1){+.+.}-{3:3}, at: filename_create+0x20b/0x450 fs/namei.c:3843 #2: ffff8880706e9808 (&sb->s_type->i_mutex_key#33){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #2: ffff8880706e9808 (&sb->s_type->i_mutex_key#33){+.+.}-{3:3}, at: ocfs2_vfs_reflink+0x2f3/0x450 fs/ocfs2/refcounttree.c:4428 #3: ffff8880706e9538 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_reflink+0x4bc/0x920 fs/ocfs2/refcounttree.c:4303 stack backtrace: CPU: 1 PID: 8601 Comm: syz.3.1092 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/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+0x2c66/0x7b50 kernel/locking/lockdep.c:5012 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623 down_write+0x38/0x60 kernel/locking/rwsem.c:1551 ocfs2_reflink+0x4cb/0x920 fs/ocfs2/refcounttree.c:4304 ocfs2_vfs_reflink+0x333/0x450 fs/ocfs2/refcounttree.c:4431 ocfs2_reflink_ioctl+0x39c/0x440 fs/ocfs2/refcounttree.c:4471 ocfs2_ioctl+0x586/0x7a0 fs/ocfs2/ioctl.c:913 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860 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:0x7fcc908f3019 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:00007fcc8eb09028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fcc90b7b180 RCX: 00007fcc908f3019 RDX: 00002000000001c0 RSI: 0000000040186f04 RDI: 0000000000000004 RBP: 00007fcc9098a00c R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fcc90b7b218 R14: 00007fcc90b7b180 R15: 00007ffe92df0248