[v5.15] possible deadlock in ocfs2_start_trans

0 views
Skip to first unread message

syzbot

unread,
Jul 23, 2026, 12:08:24 AMJul 23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: c86c4726e7f0 Linux 5.15.211
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13e78f89580000
kernel config: https://syzkaller.appspot.com/x/.config?x=6f8e2266b61925dc
dashboard link: https://syzkaller.appspot.com/bug?extid=6c85490eac27b17f0113
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c3e980557785/disk-c86c4726.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/5fbaf3714ad0/vmlinux-c86c4726.xz
kernel image: https://storage.googleapis.com/syzbot-assets/de60a4f1e940/bzImage-c86c4726.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+6c8549...@syzkaller.appspotmail.com

(syz-executor,4193,0):__ocfs2_flush_truncate_log:6055 ERROR: status = -30
(syz-executor,4193,0):ocfs2_truncate_log_shutdown:6320 ERROR: status = -30
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz-executor/4193 is trying to acquire lock:
ffff8880222b7938 ((wq_completion)ocfs2_wq){+.+.}-{0:0}, at: flush_workqueue+0x14e/0x1390 kernel/workqueue.c:2830

but task is already holding lock:
ffff888060c810e8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a6/0x6f0 fs/ocfs2/journal.c:374

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #5 (&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_shutdown_local_alloc+0x1f3/0xac0 fs/ocfs2/localalloc.c:416
ocfs2_dismount_volume+0x1e1/0x890 fs/ocfs2/super.c:1885
generic_shutdown_super+0x130/0x300 fs/super.c:475
kill_block_super+0x7c/0xe0 fs/super.c:1427
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:181
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #4 (sb_internal#4){.+.+}-{0:0}:
percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
__sb_start_write include/linux/fs.h:1811 [inline]
sb_start_intwrite include/linux/fs.h:1928 [inline]
ocfs2_start_trans+0x2a7/0x6f0 fs/ocfs2/journal.c:372
ocfs2_write_begin_inline fs/ocfs2/aops.c:1484 [inline]
ocfs2_try_to_write_inline_data fs/ocfs2/aops.c:1587 [inline]
ocfs2_write_begin_nolock+0x207c/0x44b0 fs/ocfs2/aops.c:1673
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

-> #3 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}:
down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498
ocfs2_read_virt_blocks+0x240/0x8e0 fs/ocfs2/extent_map.c:984
ocfs2_read_dir_block fs/ocfs2/dir.c:508 [inline]
ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline]
ocfs2_find_entry+0x39d/0x1f90 fs/ocfs2/dir.c:1091
ocfs2_find_files_on_disk+0xdb/0x2f0 fs/ocfs2/dir.c:1995
ocfs2_lookup_ino_from_name+0x4f/0xf0 fs/ocfs2/dir.c:2017
_ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:136 [inline]
ocfs2_get_system_file_inode+0x33f/0x7f0 fs/ocfs2/sysfile.c:112
ocfs2_init_global_system_inodes+0x315/0x6e0 fs/ocfs2/super.c:458
ocfs2_initialize_super fs/ocfs2/super.c:2279 [inline]
ocfs2_fill_super+0x4032/0x50c0 fs/ocfs2/super.c:995
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

-> #2 (&osb->system_file_mutex){+.+.}-{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
ocfs2_get_system_file_inode+0x1a4/0x7f0 fs/ocfs2/sysfile.c:101
ocfs2_queue_orphans fs/ocfs2/journal.c:2149 [inline]
ocfs2_recover_orphans fs/ocfs2/journal.c:2249 [inline]
ocfs2_complete_recovery+0xbb7/0x2110 fs/ocfs2/journal.c:1311
process_one_work+0x867/0xff0 kernel/workqueue.c:2310
worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457
kthread+0x42e/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

-> #1 ((work_completion)(&journal->j_recovery_work)){+.+.}-{0:0}:
process_one_work+0x7ba/0xff0 kernel/workqueue.c:2286
worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457
kthread+0x42e/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

-> #0 ((wq_completion)ocfs2_wq){+.+.}-{0:0}:
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
flush_workqueue+0x16a/0x1390 kernel/workqueue.c:2830
ocfs2_recovery_disable+0x2ba/0x350 fs/ocfs2/journal.c:227
ocfs2_recovery_exit+0x16/0x50 fs/ocfs2/journal.c:241
ocfs2_dismount_volume+0x1f1/0x890 fs/ocfs2/super.c:1890
generic_shutdown_super+0x130/0x300 fs/super.c:475
kill_block_super+0x7c/0xe0 fs/super.c:1427
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:181
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0

other info that might help us debug this:

Chain exists of:
(wq_completion)ocfs2_wq --> sb_internal#4 --> &journal->j_trans_barrier

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&journal->j_trans_barrier);
lock(sb_internal#4);
lock(&journal->j_trans_barrier);
lock((wq_completion)ocfs2_wq);

*** DEADLOCK ***

4 locks held by syz-executor/4193:
#0: ffff88807c32c0e0 (&type->s_umount_key#68){+.+.}-{3:3}, at: deactivate_super+0xa0/0xd0 fs/super.c:365
#1: ffff88807c32c650 (sb_internal#4){.+.+}-{0:0}, at: ocfs2_replay_truncate_records fs/ocfs2/alloc.c:5938 [inline]
#1: ffff88807c32c650 (sb_internal#4){.+.+}-{0:0}, at: __ocfs2_flush_truncate_log+0x49f/0x1110 fs/ocfs2/alloc.c:6052
#2: ffff888060c810e8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a6/0x6f0 fs/ocfs2/journal.c:374
#3: ffff88801d0fa990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x12d5/0x1560 fs/jbd2/transaction.c:462

stack backtrace:
CPU: 0 PID: 4193 Comm: syz-executor Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
Call Trace:
<TASK>
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
flush_workqueue+0x16a/0x1390 kernel/workqueue.c:2830
ocfs2_recovery_disable+0x2ba/0x350 fs/ocfs2/journal.c:227
ocfs2_recovery_exit+0x16/0x50 fs/ocfs2/journal.c:241
ocfs2_dismount_volume+0x1f1/0x890 fs/ocfs2/super.c:1890
generic_shutdown_super+0x130/0x300 fs/super.c:475
kill_block_super+0x7c/0xe0 fs/super.c:1427
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:181
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7efe56d7f0d7
Code: a2 c7 05 1c 26 25 00 00 00 00 00 eb 96 e8 e1 12 00 00 90 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffeb8bafe78 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007efe56e1330a RCX: 00007efe56d7f0d7
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffeb8baff30
RBP: 00007ffeb8baff30 R08: 00007ffeb8bb0f30 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffeb8bb0fc0
R13: 00007efe56e1330a R14: 000000000001ac1b R15: 00007ffeb8bb1000
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages