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: 111d, last: 3h44m
▶ ▼ 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 14 18h07m 265d 0/3 upstream: reported on 2026/03/07 10:54
upstream possible deadlock in ocfs2_try_to_free_truncate_log ocfs2 4 1 715d 711d 0/30 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 265d 265d 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 133 60d 587d 0/30 upstream: reported on 2025/04/19 11:02

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.2.409/6280 is trying to acquire lock:
ffff888074f06d88 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:795 [inline]
ffff888074f06d88 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}, at: ocfs2_try_to_free_truncate_log+0xb1/0x370 fs/ocfs2/alloc.c:6126

but task is already holding lock:
ffff88806fe0ea20 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_write_begin+0x193/0x310 fs/ocfs2/aops.c:1905

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}:
       down_write+0x38/0x60 kernel/locking/rwsem.c:1551
       ocfs2_create_local_dquot+0x199/0x18d0 fs/ocfs2/quota_local.c:1254
       ocfs2_acquire_dquot+0x822/0xb30 fs/ocfs2/quota_global.c:871
       dqget+0x713/0xbb0 fs/quota/dquot.c:1010
       __dquot_initialize+0x3a9/0xd00 fs/quota/dquot.c:1539
       ocfs2_get_init_inode+0x144/0x1b0 fs/ocfs2/namei.c:202
       ocfs2_mknod+0x8f5/0x2460 fs/ocfs2/namei.c:310
       ocfs2_create+0x192/0x420 fs/ocfs2/namei.c:675
       lookup_open fs/namei.c:3513 [inline]
       open_last_lookups fs/namei.c:3583 [inline]
       path_openat+0x120a/0x2fb0 fs/namei.c:3790
       do_filp_open+0x1df/0x400 fs/namei.c:3820
       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 (&dquot->dq_lock){+.+.}-{3:3}:
       __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       dquot_acquire+0x63/0x520 fs/quota/dquot.c:485
       ext4_acquire_dquot+0x2e3/0x4a0 fs/ext4/super.c:6263
       dqget+0x713/0xbb0 fs/quota/dquot.c:1010
       __dquot_initialize+0x3a9/0xd00 fs/quota/dquot.c:1539
       ext4_create+0x92/0x470 fs/ext4/namei.c:2878
       lookup_open fs/namei.c:3513 [inline]
       open_last_lookups fs/namei.c:3583 [inline]
       path_openat+0x120a/0x2fb0 fs/namei.c:3790
       do_filp_open+0x1df/0x400 fs/namei.c:3820
       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

-> #1 (jbd2_handle){++++}-{0:0}:
       jbd2_journal_lock_updates+0xa4/0x390 fs/jbd2/transaction.c:881
       __ocfs2_flush_truncate_log+0x2b4/0x1110 fs/ocfs2/alloc.c:6031
       ocfs2_flush_truncate_log+0x4b/0x60 fs/ocfs2/alloc.c:6078
       ocfs2_sync_fs+0x119/0x330 fs/ocfs2/super.c:404
       sync_filesystem+0x1be/0x220 fs/sync.c:66
       generic_shutdown_super+0x6b/0x300 fs/super.c:448
       kill_block_super+0x7c/0xe0 fs/super.c:1438
       deactivate_locked_super+0x93/0xf0 fs/super.c:335
       cleanup_mnt+0x426/0x4d0 fs/namespace.c:1148
       task_work_run+0x125/0x1a0 kernel/task_work.c:188
       tracehook_notify_resume include/linux/tracehook.h:189 [inline]
       exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:184
       exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:217
       __syscall_exit_to_user_mode_work kernel/entry/common.c:299 [inline]
       syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:310
       do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3125 [inline]
       check_prevs_add kernel/locking/lockdep.c:3244 [inline]
       validate_chain kernel/locking/lockdep.c:3860 [inline]
       __lock_acquire+0x39b7/0x7e20 kernel/locking/lockdep.c:5134
       lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5751
       down_write+0x38/0x60 kernel/locking/rwsem.c:1551
       inode_lock include/linux/fs.h:795 [inline]
       ocfs2_try_to_free_truncate_log+0xb1/0x370 fs/ocfs2/alloc.c:6126
       ocfs2_reserve_clusters_with_limit+0x48a/0xc10 fs/ocfs2/suballoc.c:1202
       ocfs2_reserve_clusters fs/ocfs2/suballoc.c:1245 [inline]
       ocfs2_lock_allocators+0x2ce/0x5f0 fs/ocfs2/suballoc.c:2701
       ocfs2_extend_allocation+0x3fe/0x1830 fs/ocfs2/file.c:609
       ocfs2_extend_no_holes+0x206/0x4b0 fs/ocfs2/file.c:1051
       ocfs2_expand_nonsparse_inode+0x15d/0x450 fs/ocfs2/aops.c:1624
       ocfs2_write_begin_nolock+0x1e46/0x44b0 fs/ocfs2/aops.c:1690
       ocfs2_write_begin+0x1b4/0x310 fs/ocfs2/aops.c:1907
       generic_perform_write+0x2b6/0x550 mm/filemap.c:3793
       __generic_file_write_iter+0x261/0x4e0 mm/filemap.c:3920
       ocfs2_file_write_iter+0x156d/0x1e90 fs/ocfs2/file.c:2503
       call_write_iter include/linux/fs.h:2181 [inline]
       new_sync_write fs/read_write.c:507 [inline]
       vfs_write+0x748/0xd70 fs/read_write.c:594
       ksys_pwrite64 fs/read_write.c:701 [inline]
       __do_sys_pwrite64 fs/read_write.c:711 [inline]
       __se_sys_pwrite64 fs/read_write.c:708 [inline]
       __x64_sys_pwrite64+0x197/0x220 fs/read_write.c:708
       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_sysfile_lock_key[args->fi_sysfile_type]#6 --> &dquot->dq_lock
 --> &ocfs2_quota_ip_alloc_sem_key

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&ocfs2_quota_ip_alloc_sem_key);
                               lock(&dquot->dq_lock);
                               lock(&ocfs2_quota_ip_alloc_sem_key);
  lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6);

 *** DEADLOCK ***

3 locks held by syz.2.409/6280:
 #0: ffff88807bb6a460
 (sb_writers#22){.+.+}-{0:0}
, at: vfs_write+0x296/0xd70 fs/read_write.c:590
 #1: 
ffff88806fe0ed88 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:795 [inline]
ffff88806fe0ed88 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: ocfs2_file_write_iter+0x311/0x1e90 fs/ocfs2/file.c:2433
 #2: ffff88806fe0ea20 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_write_begin+0x193/0x310 fs/ocfs2/aops.c:1905

stack backtrace:
CPU: 0 PID: 6280 Comm: syz.2.409 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
 check_noncircular+0x2f8/0x400 kernel/locking/lockdep.c:2178
 check_prev_add kernel/locking/lockdep.c:3125 [inline]
 check_prevs_add kernel/locking/lockdep.c:3244 [inline]
 validate_chain kernel/locking/lockdep.c:3860 [inline]
 __lock_acquire+0x39b7/0x7e20 kernel/locking/lockdep.c:5134
 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5751
 down_write+0x38/0x60 kernel/locking/rwsem.c:1551
 inode_lock include/linux/fs.h:795 [inline]
 ocfs2_try_to_free_truncate_log+0xb1/0x370 fs/ocfs2/alloc.c:6126
 ocfs2_reserve_clusters_with_limit+0x48a/0xc10 fs/ocfs2/suballoc.c:1202
 ocfs2_reserve_clusters fs/ocfs2/suballoc.c:1245 [inline]
 ocfs2_lock_allocators+0x2ce/0x5f0 fs/ocfs2/suballoc.c:2701
 ocfs2_extend_allocation+0x3fe/0x1830 fs/ocfs2/file.c:609
 ocfs2_extend_no_holes+0x206/0x4b0 fs/ocfs2/file.c:1051
 ocfs2_expand_nonsparse_inode+0x15d/0x450 fs/ocfs2/aops.c:1624
 ocfs2_write_begin_nolock+0x1e46/0x44b0 fs/ocfs2/aops.c:1690
 ocfs2_write_begin+0x1b4/0x310 fs/ocfs2/aops.c:1907
 generic_perform_write+0x2b6/0x550 mm/filemap.c:3793
 __generic_file_write_iter+0x261/0x4e0 mm/filemap.c:3920
 ocfs2_file_write_iter+0x156d/0x1e90 fs/ocfs2/file.c:2503
 call_write_iter include/linux/fs.h:2181 [inline]
 new_sync_write fs/read_write.c:507 [inline]
 vfs_write+0x748/0xd70 fs/read_write.c:594
 ksys_pwrite64 fs/read_write.c:701 [inline]
 __do_sys_pwrite64 fs/read_write.c:711 [inline]
 __se_sys_pwrite64 fs/read_write.c:708 [inline]
 __x64_sys_pwrite64+0x197/0x220 fs/read_write.c:708
 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:0x7fc573038b59
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:00007fc571285028 EFLAGS: 00000246
 ORIG_RAX: 0000000000000012
RAX: ffffffffffffffda RBX: 00007fc5732c4fa0 RCX: 00007fc573038b59
RDX: 0000000000000001 RSI: 0000200000017f40 RDI: 0000000000000005
RBP: 00007fc5730c918b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000008000c61 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fc5732c5038 R14: 00007fc5732c4fa0 R15: 00007ffe4b678a38
 </TASK>
kcov: kcov_task_exit: t = ffff88802799d940, kcov->t = ffff88802799d940

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/27 13:53 linux-5.15.y 4f2df9a01754 bff1a522 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ocfs2_try_to_free_truncate_log
2026/11/27 02:00 linux-5.15.y 4f2df9a01754 f1f6b8bf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ocfs2_try_to_free_truncate_log
2026/11/27 01:59 linux-5.15.y 4f2df9a01754 f1f6b8bf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ocfs2_try_to_free_truncate_log
2026/11/13 11:14 linux-5.15.y 29c6cdaac04a 26b2fee0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ocfs2_try_to_free_truncate_log
2026/11/13 11:13 linux-5.15.y 29c6cdaac04a 26b2fee0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ocfs2_try_to_free_truncate_log
2026/10/29 07:13 linux-5.15.y 792fbe1537d8 b1d00f76 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ocfs2_try_to_free_truncate_log
2026/10/05 15:11 linux-5.15.y a051a4bf909f af63e995 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ocfs2_try_to_free_truncate_log
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.