possible deadlock in ocfs2_try_to_free_truncate_log (2)

Status: upstream: reported on 2026/08/08 07:37
Reported-by: syzbot+7564934225c15412d0e3@syzkaller.appspotmail.com
First crash: 5d09h, last: 5d09h
Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in ocfs2_try_to_free_truncate_log 4 5 4d10h 159d 0/3 upstream: reported on 2026/03/07 10:54
upstream possible deadlock in ocfs2_try_to_free_truncate_log ocfs2 4 1 609d 605d 0/29 auto-obsoleted due to no activity on 2025/03/22 03:11
linux-5.15 possible deadlock in ocfs2_try_to_free_truncate_log 4 1 159d 159d 0/3 auto-obsoleted due to no activity on 2026/06/14 19:37
upstream possible deadlock in ocfs2_try_to_free_truncate_log (2) prio:high ocfs2 4 129 1d02h 481d 0/29 upstream: reported on 2025/04/19 11:02

Sample crash report:
============================================
WARNING: possible recursive locking detected
syzkaller #0 Not tainted
--------------------------------------------
syz.3.220/5084 is trying to acquire lock:
ffff888061273488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
ffff888061273488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}, at: ocfs2_try_to_free_truncate_log+0xb1/0x370 fs/ocfs2/alloc.c:6122

but task is already holding lock:
ffff888061273488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
ffff888061273488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}, at: ocfs2_defrag_extent fs/ocfs2/move_extents.c:253 [inline]
ffff888061273488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}, at: __ocfs2_move_extents_range+0x1221/0x3450 fs/ocfs2/move_extents.c:865

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6);
  lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

5 locks held by syz.3.220/5084:
 #0: ffff88814c810460 (sb_writers#26){.+.+}-{0:0}, at: mnt_want_write_file+0x5c/0x200 fs/namespace.c:430
 #1: ffff888061275108 (&sb->s_type->i_mutex_key#34){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
 #1: ffff888061275108 (&sb->s_type->i_mutex_key#34){+.+.}-{3:3}, at: ocfs2_move_extents+0x19d/0xa40 fs/ocfs2/move_extents.c:918
 #2: ffff888061274da0 (&oi->ip_alloc_sem){++++}-{3:3}, at: ocfs2_move_extents+0x3fc/0xa40 fs/ocfs2/move_extents.c:938
 #3: ffff888074a16d88 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
 #3: ffff888074a16d88 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x16d/0x44b0 fs/ocfs2/suballoc.c:804
 #4: ffff888061273488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
 #4: ffff888061273488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}, at: ocfs2_defrag_extent fs/ocfs2/move_extents.c:253 [inline]
 #4: ffff888061273488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}, at: __ocfs2_move_extents_range+0x1221/0x3450 fs/ocfs2/move_extents.c:865

stack backtrace:
CPU: 0 PID: 5084 Comm: syz.3.220 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
 __lock_acquire+0x1247/0x7b50 kernel/locking/lockdep.c:-1
 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
 down_write+0x38/0x60 kernel/locking/rwsem.c:1551
 inode_lock include/linux/fs.h:787 [inline]
 ocfs2_try_to_free_truncate_log+0xb1/0x370 fs/ocfs2/alloc.c:6122
 ocfs2_reserve_clusters_with_limit+0x48a/0xc10 fs/ocfs2/suballoc.c:1202
 ocfs2_defrag_extent fs/ocfs2/move_extents.c:272 [inline]
 __ocfs2_move_extents_range+0x15d6/0x3450 fs/ocfs2/move_extents.c:865
 ocfs2_move_extents+0x409/0xa40 fs/ocfs2/move_extents.c:940
 ocfs2_ioctl_move_extents+0x4d7/0x6e0 fs/ocfs2/move_extents.c:1066
 ocfs2_ioctl+0x31f/0x7a0 fs/ocfs2/ioctl.c:947
 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:0x7f7b16a2b0d9
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:00007f7b14c62028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f7b16cb3090 RCX: 00007f7b16a2b0d9
RDX: 00002000000000c0 RSI: 0000000040406f06 RDI: 0000000000000008
RBP: 00007f7b16ac2024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f7b16cb3128 R14: 00007f7b16cb3090 R15: 00007ffe5c340fe8
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/08 07:36 linux-5.15.y aabd761612db 5d63f80b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ocfs2_try_to_free_truncate_log
* Struck through repros no longer work on HEAD.