syzbot
possible deadlock in ocfs2_reflink
Status:
upstream: reported on 2026/07/30 00:10
Subsystems:
ocfs2
Labels:
prio:high
[Documentation on labels]
Reported-by: syzbot+e42eae29bba35810f43c@syzkaller.appspotmail.com
First crash: 6d21h, last: 1d05h
Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Tainted: G L
------------------------------------------------------
syz.8.677/8588 is trying to acquire lock:
ffff888051edf658 (&oi->ip_alloc_sem){++++}-{4:4}, at: ocfs2_reflink+0x596/0xbb0 fs/ocfs2/refcounttree.c:4272
but task is already holding lock:
ffff888051edf6e8 (&oi->ip_xattr_sem){++++}-{4:4}, at: ocfs2_reflink+0x582/0xbb0 fs/ocfs2/refcounttree.c:4271
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #3 (&oi->ip_xattr_sem){++++}-{4:4}:
lock_acquire kernel/locking/lockdep.c:5868 [inline]
lock_acquire+0x1b9/0x370 kernel/locking/lockdep.c:5825
down_read+0x99/0x4c0 kernel/locking/rwsem.c:1574
ocfs2_init_acl+0x35b/0x840 fs/ocfs2/acl.c:367
ocfs2_mknod+0x173c/0x2770 fs/ocfs2/namei.c:414
ocfs2_create+0xf4/0x430 fs/ocfs2/namei.c:677
lookup_open fs/namei.c:4508 [inline]
open_last_lookups fs/namei.c:4608 [inline]
path_openat+0x341f/0x4280 fs/namei.c:4860
do_file_open+0x20e/0x430 fs/namei.c:4892
do_sys_openat2+0x10f/0x1e0 fs/open.c:1368
do_sys_open fs/open.c:1374 [inline]
__do_sys_creat fs/open.c:1452 [inline]
__se_sys_creat fs/open.c:1446 [inline]
__x64_sys_creat+0xcc/0x120 fs/open.c:1446
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
-> #2 (&journal->j_trans_barrier){.+.+}-{4:4}:
lock_acquire kernel/locking/lockdep.c:5868 [inline]
lock_acquire+0x1b9/0x370 kernel/locking/lockdep.c:5825
down_read+0x99/0x4c0 kernel/locking/rwsem.c:1574
ocfs2_start_trans+0x5cc/0x8f0 fs/ocfs2/journal.c:369
ocfs2_modify_bh+0xbe/0x440 fs/ocfs2/quota_local.c:101
ocfs2_local_read_info+0xd5c/0x1640 fs/ocfs2/quota_local.c:767
dquot_load_quota_sb+0x7c1/0x11d0 fs/quota/dquot.c:2484
dquot_load_quota_inode fs/quota/dquot.c:2521 [inline]
dquot_load_quota_inode+0x2a3/0x470 fs/quota/dquot.c:2513
ocfs2_enable_quotas+0x28a/0x5a0 fs/ocfs2/super.c:930
ocfs2_fill_super.cold+0x1cd/0x3ae fs/ocfs2/super.c:1140
get_tree_bdev_flags+0x38c/0x620 fs/super.c:1640
vfs_get_tree+0x92/0x320 fs/super.c:1700
fc_mount fs/namespace.c:1198 [inline]
do_new_mount_fc fs/namespace.c:3765 [inline]
do_new_mount fs/namespace.c:3841 [inline]
path_mount+0x7d0/0x23d0 fs/namespace.c:4161
do_mount fs/namespace.c:4174 [inline]
__do_sys_mount fs/namespace.c:4390 [inline]
__se_sys_mount fs/namespace.c:4367 [inline]
__x64_sys_mount+0x293/0x310 fs/namespace.c:4367
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
-> #1 (sb_internal#4){.+.+}-{0:0}:
lock_acquire kernel/locking/lockdep.c:5868 [inline]
lock_acquire+0x1b9/0x370 kernel/locking/lockdep.c:5825
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+0x4bb/0x8f0 fs/ocfs2/journal.c:367
ocfs2_write_begin_inline fs/ocfs2/aops.c:1460 [inline]
ocfs2_try_to_write_inline_data fs/ocfs2/aops.c:1564 [inline]
ocfs2_write_begin_nolock+0x1b4f/0x6be0 fs/ocfs2/aops.c:1650
ocfs2_write_begin+0x1cb/0x340 fs/ocfs2/aops.c:1885
generic_perform_write+0x292/0xa40 mm/filemap.c:4358
__generic_file_write_iter+0x1f7/0x240 mm/filemap.c:4475
ocfs2_file_write_iter+0xda5/0x2200 fs/ocfs2/file.c:2481
new_sync_write fs/read_write.c:595 [inline]
vfs_write+0x6ac/0x1050 fs/read_write.c:687
ksys_write+0x12a/0x250 fs/read_write.c:739
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
-> #0 (&oi->ip_alloc_sem){++++}-{4:4}:
check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3165
check_prevs_add kernel/locking/lockdep.c:3284 [inline]
validate_chain kernel/locking/lockdep.c:3908 [inline]
__lock_acquire+0x136c/0x1a40 kernel/locking/lockdep.c:5237
lock_acquire kernel/locking/lockdep.c:5868 [inline]
lock_acquire+0x1b9/0x370 kernel/locking/lockdep.c:5825
down_write+0x8b/0x1f0 kernel/locking/rwsem.c:1631
ocfs2_reflink+0x596/0xbb0 fs/ocfs2/refcounttree.c:4272
ocfs2_vfs_reflink fs/ocfs2/refcounttree.c:4399 [inline]
ocfs2_reflink_ioctl+0x7cd/0xa60 fs/ocfs2/refcounttree.c:4439
ocfs2_ioctl+0x5e8/0x6e0 fs/ocfs2/ioctl.c:920
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x115/0x870 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:
&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 ***
4 locks held by syz.8.677/8588:
#0: ffff888050436450 (sb_writers#22){.+.+}-{0:0}, at: filename_create+0x10d/0x400 fs/namei.c:4948
#1: ffff88806a2717a0 (&type->i_mutex_dir_key#13/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1069 [inline]
#1: ffff88806a2717a0 (&type->i_mutex_dir_key#13/1){+.+.}-{4:4}, at: __start_dirop fs/namei.c:2918 [inline]
#1: ffff88806a2717a0 (&type->i_mutex_dir_key#13/1){+.+.}-{4:4}, at: start_dirop fs/namei.c:2942 [inline]
#1: ffff88806a2717a0 (&type->i_mutex_dir_key#13/1){+.+.}-{4:4}, at: filename_create+0x1c0/0x400 fs/namei.c:4955
#2: ffff888051edf9a0 (&sb->s_type->i_mutex_key#32){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1024 [inline]
#2: ffff888051edf9a0 (&sb->s_type->i_mutex_key#32){+.+.}-{4:4}, at: ocfs2_vfs_reflink fs/ocfs2/refcounttree.c:4396 [inline]
#2: ffff888051edf9a0 (&sb->s_type->i_mutex_key#32){+.+.}-{4:4}, at: ocfs2_reflink_ioctl+0x689/0xa60 fs/ocfs2/refcounttree.c:4439
#3: ffff888051edf6e8 (&oi->ip_xattr_sem){++++}-{4:4}, at: ocfs2_reflink+0x582/0xbb0 fs/ocfs2/refcounttree.c:4271
stack backtrace:
CPU: 0 UID: 0 PID: 8588 Comm: syz.8.677 Tainted: G L syzkaller #0 PREEMPT(full)
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_circular_bug.cold+0x178/0x1c7 kernel/locking/lockdep.c:2043
check_noncircular+0x146/0x160 kernel/locking/lockdep.c:2175
check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3165
check_prevs_add kernel/locking/lockdep.c:3284 [inline]
validate_chain kernel/locking/lockdep.c:3908 [inline]
__lock_acquire+0x136c/0x1a40 kernel/locking/lockdep.c:5237
lock_acquire kernel/locking/lockdep.c:5868 [inline]
lock_acquire+0x1b9/0x370 kernel/locking/lockdep.c:5825
down_write+0x8b/0x1f0 kernel/locking/rwsem.c:1631
ocfs2_reflink+0x596/0xbb0 fs/ocfs2/refcounttree.c:4272
ocfs2_vfs_reflink fs/ocfs2/refcounttree.c:4399 [inline]
ocfs2_reflink_ioctl+0x7cd/0xa60 fs/ocfs2/refcounttree.c:4439
ocfs2_ioctl+0x5e8/0x6e0 fs/ocfs2/ioctl.c:920
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f074979e019
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:00007f074a66c028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f0749a25fa0 RCX: 00007f074979e019
RDX: 00002000000001c0 RSI: 0000000040186f04 RDI: 0000000000000005
RBP: 00007f074983500c R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f0749a26038 R14: 00007f0749a25fa0 R15: 00007ffe59399388
</TASK>
* Struck through repros no longer work on HEAD.