(kworker/u4:3,421,1):__ocfs2_flush_truncate_log:6055 ERROR: status = -30
(kworker/u4:3,421,1):ocfs2_truncate_log_worker:6089 ERROR: status = -30
BUG: workqueue leaked lock or atomic: kworker/u4:3/0x00000000/421
last function: ocfs2_truncate_log_worker
3 locks held by kworker/u4:3/421:
#0:
ffff888078ff2650 (sb_internal#2){.+.+}-{0:0}, at: ocfs2_replay_truncate_records fs/ocfs2/alloc.c:5938 [inline]
ffff888078ff2650 (sb_internal#2){.+.+}-{0:0}, at: __ocfs2_flush_truncate_log+0x49f/0x1110 fs/ocfs2/alloc.c:6052
#1: ffff88802273fce8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a6/0x6f0 fs/ocfs2/journal.c:374
#2: ffff888055d1c990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x12d5/0x1560 fs/jbd2/transaction.c:462
CPU: 1 PID: 421 Comm: kworker/u4:3 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Workqueue: ocfs2_wq ocfs2_truncate_log_worker
Call Trace:
dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
process_one_work+0xc68/0xff0 kernel/workqueue.c:2325
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
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
kworker/u4:3/421 is trying to acquire lock:
ffff88805e44c938 ((wq_completion)loop5){+.+.}-{0:0}, at: process_one_work+0x75c/0xff0 kernel/workqueue.c:-1
but task is already holding lock:
ffff888055d1c990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x12d5/0x1560 fs/jbd2/transaction.c:462
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #8 (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:6027
ocfs2_flush_truncate_log fs/ocfs2/alloc.c:6074 [inline]
ocfs2_truncate_log_worker+0x9f/0x190 fs/ocfs2/alloc.c:6087
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
-> #7 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}:
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
inode_lock include/linux/fs.h:793 [inline]
ocfs2_remove_btree_range+0x64f/0x15e0 fs/ocfs2/alloc.c:5742
ocfs2_remove_inode_range+0xf4a/0x2610 fs/ocfs2/file.c:1910
ocfs2_reflink_remap_extent fs/ocfs2/refcounttree.c:4595 [inline]
ocfs2_reflink_remap_blocks+0xc6b/0x1ab0 fs/ocfs2/refcounttree.c:4742
ocfs2_remap_file_range+0x4a7/0x740 fs/ocfs2/file.c:2706
vfs_copy_file_range+0xcce/0x1430 fs/read_write.c:1510
__do_sys_copy_file_range fs/read_write.c:1588 [inline]
__se_sys_copy_file_range+0x320/0x470 fs/read_write.c:1551
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
-> #6 (&oi->ip_alloc_sem/1){+.+.}-{3:3}:
down_write_nested+0x3b/0x60 kernel/locking/rwsem.c:1667
ocfs2_remap_file_range+0x3f0/0x740 fs/ocfs2/file.c:2698
vfs_copy_file_range+0xcce/0x1430 fs/read_write.c:1510
__do_sys_copy_file_range fs/read_write.c:1588 [inline]
__se_sys_copy_file_range+0x320/0x470 fs/read_write.c:1551
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
-> #5 (&oi->ip_alloc_sem){++++}-{3:3}:
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
ocfs2_page_mkwrite+0x2c4/0xaa0 fs/ocfs2/mmap.c:141
do_page_mkwrite+0x168/0x3c0 mm/memory.c:2922
do_shared_fault mm/memory.c:4328 [inline]
do_fault mm/memory.c:4396 [inline]
handle_pte_fault mm/memory.c:4650 [inline]
__handle_mm_fault mm/memory.c:4785 [inline]
handle_mm_fault+0x1e47/0x4440 mm/memory.c:4883
do_user_addr_fault+0x494/0xc90 arch/x86/mm/fault.c:1355
handle_page_fault arch/x86/mm/fault.c:1443 [inline]
exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1496
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606
-> #4 (sb_pagefaults#2){.+.+}-{0:0}
:
percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
__sb_start_write include/linux/fs.h:1817 [inline]
sb_start_pagefault include/linux/fs.h:1916 [inline]
ocfs2_page_mkwrite+0x1a7/0xaa0 fs/ocfs2/mmap.c:121
do_page_mkwrite+0x168/0x3c0 mm/memory.c:2922
do_shared_fault mm/memory.c:4328 [inline]
do_fault mm/memory.c:4396 [inline]
handle_pte_fault mm/memory.c:4650 [inline]
__handle_mm_fault mm/memory.c:4785 [inline]
handle_mm_fault+0x1e47/0x4440 mm/memory.c:4883
do_user_addr_fault+0x494/0xc90 arch/x86/mm/fault.c:1355
handle_page_fault arch/x86/mm/fault.c:1443 [inline]
exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1496
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606
-> #3 (
&mm->mmap_lock){++++}-{3:3}
:
__might_fault+0xb3/0x110 mm/memory.c:5357
_copy_from_user+0x29/0x170 lib/usercopy.c:14
copy_from_user include/linux/uaccess.h:192 [inline]
fill_psinfo fs/binfmt_elf.c:1561 [inline]
fill_note_info fs/binfmt_elf.c:1881 [inline]
elf_core_dump+0x1599/0x3530 fs/binfmt_elf.c:2199
do_coredump+0x14e8/0x2a40 fs/coredump.c:894
get_signal+0x531/0x12e0 kernel/signal.c:2899
arch_do_signal_or_restart+0xe6/0x12a0 arch/x86/kernel/signal.c:867
handle_signal_work kernel/entry/common.c:157 [inline]
exit_to_user_mode_loop+0x9e/0x130 kernel/entry/common.c:181
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:217
irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:323
exc_page_fault+0x88/0x100 arch/x86/mm/fault.c:1499
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606
-> #2
(sb_writers#3){.+.+}-{0:0}:
percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
__sb_start_write include/linux/fs.h:1817 [inline]
sb_start_write include/linux/fs.h:1887 [inline]
file_start_write include/linux/fs.h:3054 [inline]
lo_write_bvec+0x194/0x780 drivers/block/loop.c:315
lo_write_simple drivers/block/loop.c:338 [inline]
do_req_filebacked drivers/block/loop.c:656 [inline]
loop_handle_cmd drivers/block/loop.c:2235 [inline]
loop_process_work+0x1b66/0x24c0 drivers/block/loop.c:2275
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)(&worker->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)loop5){+.+.}-{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:5625
process_one_work+0x795/0xff0 kernel/workqueue.c:2285
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
other info that might help us debug this:
Chain exists of:
(wq_completion)loop5 --> &ocfs2_sysfile_lock_key[args->fi_sysfile_type]
#6 -->
jbd2_handle
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(jbd2_handle);
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6
);
lock(jbd2_handle);
lock((wq_completion)loop5);
*** DEADLOCK ***
3 locks held by kworker/u4:3/421:
#0: ffff888078ff2650 (sb_internal#2){.+.+}-{0:0}, at: ocfs2_replay_truncate_records fs/ocfs2/alloc.c:5938 [inline]
#0: ffff888078ff2650 (sb_internal#2){.+.+}-{0:0}, at: __ocfs2_flush_truncate_log+0x49f/0x1110 fs/ocfs2/alloc.c:6052
#1: ffff88802273fce8 (
&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a6/0x6f0 fs/ocfs2/journal.c:374
#2:
ffff888055d1c990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x12d5/0x1560 fs/jbd2/transaction.c:462
stack backtrace:
CPU: 1 PID: 421 Comm: kworker/u4:3 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Workqueue: loop5 loop_workfn
Call Trace:
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:5625
process_one_work+0x795/0xff0 kernel/workqueue.c:2285
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