====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.1.146/4997 is trying to acquire lock: ffff8880474b8660 (&oi->ip_alloc_sem){++++}-{3:3}, at: ocfs2_try_remove_refcount_tree+0xb3/0x360 fs/ocfs2/refcounttree.c:932 but task is already holding lock: ffff8880474b86f8 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_try_remove_refcount_tree+0xa1/0x360 fs/ocfs2/refcounttree.c:931 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+0x42/0x2d0 kernel/locking/rwsem.c:1520 ocfs2_init_acl+0x307/0x770 fs/ocfs2/acl.c:365 ocfs2_mknod+0x18e0/0x2580 fs/ocfs2/namei.c:410 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 -> #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_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:2492 dquot_load_quota_inode+0x2d3/0x5c0 fs/quota/dquot.c:2529 ocfs2_enable_quotas+0x1c0/0x4a0 fs/ocfs2/super.c:926 ocfs2_fill_super+0x434e/0x5020 fs/ocfs2/super.c:1139 mount_bdev+0x28a/0x3c0 fs/super.c:1443 legacy_get_tree+0xe6/0x180 fs/fs_context.c:632 vfs_get_tree+0x88/0x270 fs/super.c:1573 do_new_mount+0x247/0xa40 fs/namespace.c:3078 do_mount fs/namespace.c:3421 [inline] __do_sys_mount fs/namespace.c:3629 [inline] __se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3606 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#3){.+.+}-{0:0}: __lock_release kernel/locking/lockdep.c:5390 [inline] lock_release+0x347/0x920 kernel/locking/lockdep.c:5696 up_write+0x29/0x410 kernel/locking/rwsem.c:1625 inode_unlock include/linux/fs.h:763 [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+0x4504/0x4590 fs/ocfs2/aops.c:1827 ocfs2_dio_wr_get_block+0xba4/0x1810 fs/ocfs2/aops.c:2241 get_more_blocks fs/direct-io.c:659 [inline] do_direct_IO fs/direct-io.c:947 [inline] __blockdev_direct_IO+0x171f/0x34c0 fs/direct-io.c:1260 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 -> #0 (&oi->ip_alloc_sem){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3830 [inline] __lock_acquire+0x2d18/0x7c40 kernel/locking/lockdep.c:5063 lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5676 down_write+0x36/0x60 kernel/locking/rwsem.c:1573 ocfs2_try_remove_refcount_tree+0xb3/0x360 fs/ocfs2/refcounttree.c:932 ocfs2_truncate_file+0xef5/0x1660 fs/ocfs2/file.c:517 ocfs2_setattr+0x16f8/0x1d90 fs/ocfs2/file.c:1212 notify_change+0xca0/0xf90 fs/attr.c:499 do_truncate+0x1ac/0x240 fs/open.c:65 do_coredump+0x21af/0x2480 fs/coredump.c:801 get_signal+0x1093/0x1340 kernel/signal.c:2858 arch_do_signal_or_restart+0xc4/0x1310 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210 irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:316 exc_page_fault+0x88/0x100 arch/x86/mm/fault.c:1485 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608 other info that might help us debug this: Chain exists of: &oi->ip_alloc_sem --> &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(&oi->ip_alloc_sem); *** DEADLOCK *** 2 locks held by syz.1.146/4997: #0: ffff8880474b89c8 (&sb->s_type->i_mutex_key#22){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #0: ffff8880474b89c8 (&sb->s_type->i_mutex_key#22){+.+.}-{3:3}, at: do_truncate+0x198/0x240 fs/open.c:63 #1: ffff8880474b86f8 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_try_remove_refcount_tree+0xa1/0x360 fs/ocfs2/refcounttree.c:931 stack backtrace: CPU: 0 PID: 4997 Comm: syz.1.146 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:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3830 [inline] __lock_acquire+0x2d18/0x7c40 kernel/locking/lockdep.c:5063 lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5676 down_write+0x36/0x60 kernel/locking/rwsem.c:1573 ocfs2_try_remove_refcount_tree+0xb3/0x360 fs/ocfs2/refcounttree.c:932 ocfs2_truncate_file+0xef5/0x1660 fs/ocfs2/file.c:517 ocfs2_setattr+0x16f8/0x1d90 fs/ocfs2/file.c:1212 notify_change+0xca0/0xf90 fs/attr.c:499 do_truncate+0x1ac/0x240 fs/open.c:65 do_coredump+0x21af/0x2480 fs/coredump.c:801 get_signal+0x1093/0x1340 kernel/signal.c:2858 arch_do_signal_or_restart+0xc4/0x1310 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210 irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:316 exc_page_fault+0x88/0x100 arch/x86/mm/fault.c:1485 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608 RIP: 0033:0x7f9f4c19de61 Code: 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 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f RSP: 002b:0000000000000050 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007f9f4c425fa0 RCX: 00007f9f4c19de59 RDX: 0000000000000000 RSI: 0000000000000050 RDI: 0000000000000000 RBP: 00007f9f4c233e6f R08: 00002000000001c0 R09: 00002000000001c0 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f9f4c426038 R14: 00007f9f4c425fa0 R15: 00007ffc930f3488