[parent not found: <kl7jac3bqyd3dz4uj5rp3dwam6rdbegvf5qahgn7njdaeodndj@aq7yil27yawv>]
* Re: [syzbot] [ocfs2?] possible deadlock in __ocfs2_flush_truncate_log
[not found] <kl7jac3bqyd3dz4uj5rp3dwam6rdbegvf5qahgn7njdaeodndj@aq7yil27yawv>
@ 2025-07-05 3:06 ` syzbot
2025-07-05 3:10 ` Ivan Pravdin
0 siblings, 1 reply; 7+ messages in thread
From: syzbot @ 2025-07-05 3:06 UTC (permalink / raw)
To: ipravdin.official, linux-kernel, syzkaller-bugs
Hello,
syzbot tried to test the proposed patch but the build/boot failed:
failed to apply patch:
checking file fs/ocfs2/move_extents.c
patch: **** unexpected end of file in patch
Tested on:
commit: a79a588f Merge tag 'pm-6.16-rc5' of git://git.kernel.o..
git tree: upstream
kernel config: https://syzkaller.appspot.com/x/.config?x=fd0cea6d0f67318f
dashboard link: https://syzkaller.appspot.com/bug?extid=6bf948e47f9bac7aacfa
compiler:
patch: https://syzkaller.appspot.com/x/patch.diff?x=17f8d48c580000
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [syzbot] [ocfs2?] possible deadlock in __ocfs2_flush_truncate_log
2025-07-05 3:06 ` syzbot
@ 2025-07-05 3:10 ` Ivan Pravdin
2025-07-05 3:12 ` syzbot
0 siblings, 1 reply; 7+ messages in thread
From: Ivan Pravdin @ 2025-07-05 3:10 UTC (permalink / raw)
To: syzbot+6bf948e47f9bac7aacfa
Cc: ipravdin.official, linux-kernel, syzkaller-bugs
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c
index 369c7d27befd..ab460cb2c9c8 100644
--- a/fs/ocfs2/move_extents.c
+++ b/fs/ocfs2/move_extents.c
@@ -617,6 +617,8 @@ static int ocfs2_move_extent(struct ocfs2_move_extents_context *context,
*/
credits += OCFS2_INODE_UPDATE_CREDITS + 1;
+ inode_lock(tl_inode);
+
/*
* ocfs2_move_extent() didn't reserve any clusters in lock_allocators()
* logic, while we still need to lock the global_bitmap.
@@ -637,8 +639,6 @@ static int ocfs2_move_extent(struct ocfs2_move_extents_context *context,
goto out_unlock_gb_mutex;
}
- inode_lock(tl_inode);
-
handle = ocfs2_start_trans(osb, credits);
if (IS_ERR(handle)) {
ret = PTR_ERR(handle);
Ivan Pravdin
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [syzbot] [ocfs2?] possible deadlock in __ocfs2_flush_truncate_log
@ 2025-03-15 11:28 syzbot
2025-07-05 3:03 ` syzbot
2025-07-05 3:16 ` syzbot
0 siblings, 2 replies; 7+ messages in thread
From: syzbot @ 2025-03-15 11:28 UTC (permalink / raw)
To: jlbec, joseph.qi, linux-kernel, mark, ocfs2-devel, syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: 4003c9e78778 Merge tag 'net-6.14-rc7' of git://git.kernel...
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=114d0fa8580000
kernel config: https://syzkaller.appspot.com/x/.config?x=eb44f62cb82f8a0a
dashboard link: https://syzkaller.appspot.com/bug?extid=6bf948e47f9bac7aacfa
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=119f2c78580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1469304c580000
Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/7feb34a89c2a/non_bootable_disk-4003c9e7.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d5eb122d2f89/vmlinux-4003c9e7.xz
kernel image: https://storage.googleapis.com/syzbot-assets/51856a1503a2/bzImage-4003c9e7.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/2e8806b27a27/mount_0.gz
fsck result: OK (log: https://syzkaller.appspot.com/x/fsck.log?x=100d7654580000)
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+6bf948e47f9bac7aacfa@syzkaller.appspotmail.com
======================================================
WARNING: possible circular locking dependency detected
6.14.0-rc6-syzkaller-00103-g4003c9e78778 #0 Not tainted
------------------------------------------------------
kworker/u4:1/14 is trying to acquire lock:
ffff8880447bd100 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:877 [inline]
ffff8880447bd100 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{4:4}, at: __ocfs2_flush_truncate_log+0x388/0x1240 fs/ocfs2/alloc.c:6046
but task is already holding lock:
ffff8880447c3480 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:877 [inline]
ffff8880447c3480 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{4:4}, at: ocfs2_flush_truncate_log fs/ocfs2/alloc.c:6075 [inline]
ffff8880447c3480 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{4:4}, at: ocfs2_truncate_log_worker+0x9a/0x1b0 fs/ocfs2/alloc.c:6089
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{4:4}:
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851
down_write+0x99/0x220 kernel/locking/rwsem.c:1577
inode_lock include/linux/fs.h:877 [inline]
ocfs2_move_extent fs/ocfs2/move_extents.c:640 [inline]
__ocfs2_move_extents_range+0x1f0b/0x4440 fs/ocfs2/move_extents.c:860
ocfs2_move_extents+0x3ee/0xac0 fs/ocfs2/move_extents.c:927
ocfs2_ioctl_move_extents+0x61a/0x830 fs/ocfs2/move_extents.c:1053
ocfs2_ioctl+0x196/0x7d0 fs/ocfs2/ioctl.c:946
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:906 [inline]
__se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
-> #0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{4:4}:
check_prev_add kernel/locking/lockdep.c:3163 [inline]
check_prevs_add kernel/locking/lockdep.c:3282 [inline]
validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3906
__lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5228
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851
down_write+0x99/0x220 kernel/locking/rwsem.c:1577
inode_lock include/linux/fs.h:877 [inline]
__ocfs2_flush_truncate_log+0x388/0x1240 fs/ocfs2/alloc.c:6046
ocfs2_flush_truncate_log fs/ocfs2/alloc.c:6076 [inline]
ocfs2_truncate_log_worker+0xa2/0x1b0 fs/ocfs2/alloc.c:6089
process_one_work kernel/workqueue.c:3238 [inline]
process_scheduled_works+0xabe/0x18e0 kernel/workqueue.c:3319
worker_thread+0x870/0xd30 kernel/workqueue.c:3400
kthread+0x7a9/0x920 kernel/kthread.c:464
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6);
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5);
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6);
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5);
*** DEADLOCK ***
3 locks held by kworker/u4:1/14:
#0: ffff88803f7b2948 ((wq_completion)ocfs2_wq){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3213 [inline]
#0: ffff88803f7b2948 ((wq_completion)ocfs2_wq){+.+.}-{0:0}, at: process_scheduled_works+0x98b/0x18e0 kernel/workqueue.c:3319
#1: ffffc9000040fc60 ((work_completion)(&(&osb->osb_truncate_log_wq)->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3214 [inline]
#1: ffffc9000040fc60 ((work_completion)(&(&osb->osb_truncate_log_wq)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x9c6/0x18e0 kernel/workqueue.c:3319
#2: ffff8880447c3480 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:877 [inline]
#2: ffff8880447c3480 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{4:4}, at: ocfs2_flush_truncate_log fs/ocfs2/alloc.c:6075 [inline]
#2: ffff8880447c3480 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{4:4}, at: ocfs2_truncate_log_worker+0x9a/0x1b0 fs/ocfs2/alloc.c:6089
stack backtrace:
CPU: 0 UID: 0 PID: 14 Comm: kworker/u4:1 Not tainted 6.14.0-rc6-syzkaller-00103-g4003c9e78778 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Workqueue: ocfs2_wq ocfs2_truncate_log_worker
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2076
check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2208
check_prev_add kernel/locking/lockdep.c:3163 [inline]
check_prevs_add kernel/locking/lockdep.c:3282 [inline]
validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3906
__lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5228
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851
down_write+0x99/0x220 kernel/locking/rwsem.c:1577
inode_lock include/linux/fs.h:877 [inline]
__ocfs2_flush_truncate_log+0x388/0x1240 fs/ocfs2/alloc.c:6046
ocfs2_flush_truncate_log fs/ocfs2/alloc.c:6076 [inline]
ocfs2_truncate_log_worker+0xa2/0x1b0 fs/ocfs2/alloc.c:6089
process_one_work kernel/workqueue.c:3238 [inline]
process_scheduled_works+0xabe/0x18e0 kernel/workqueue.c:3319
worker_thread+0x870/0xd30 kernel/workqueue.c:3400
kthread+0x7a9/0x920 kernel/kthread.c:464
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
</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 syzkaller@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 syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
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
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [syzbot] [ocfs2?] possible deadlock in __ocfs2_flush_truncate_log
2025-03-15 11:28 syzbot
@ 2025-07-05 3:03 ` syzbot
2025-07-05 3:16 ` syzbot
1 sibling, 0 replies; 7+ messages in thread
From: syzbot @ 2025-07-05 3:03 UTC (permalink / raw)
To: linux-kernel
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: Re: [syzbot] [ocfs2?] possible deadlock in __ocfs2_flush_truncate_log
Author: ipravdin.official@gmail.com
#syz test
diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c
index 369c7d27befd..ab460cb2c9c8 100644
--- a/fs/ocfs2/move_extents.c
+++ b/fs/ocfs2/move_extents.c
@@ -617,6 +617,8 @@ static int ocfs2_move_extent(struct ocfs2_move_extents_context *context,
*/
credits += OCFS2_INODE_UPDATE_CREDITS + 1;
+ inode_lock(tl_inode);
+
/*
* ocfs2_move_extent() didn't reserve any clusters in lock_allocators()
* logic, while we still need to lock the global_bitmap.
@@ -637,8 +639,6 @@ static int ocfs2_move_extent(struct ocfs2_move_extents_context *context,
goto out_unlock_gb_mutex;
}
- inode_lock(tl_inode);
-
handle = ocfs2_start_trans(osb, credits);
if (IS_ERR(handle)) {
ret = PTR_ERR(handle);
Ivan Pravdin
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [syzbot] [ocfs2?] possible deadlock in __ocfs2_flush_truncate_log
2025-03-15 11:28 syzbot
2025-07-05 3:03 ` syzbot
@ 2025-07-05 3:16 ` syzbot
1 sibling, 0 replies; 7+ messages in thread
From: syzbot @ 2025-07-05 3:16 UTC (permalink / raw)
To: linux-kernel
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: Re: [syzbot] [ocfs2?] possible deadlock in __ocfs2_flush_truncate_log
Author: ipravdin.official@gmail.com
#syz test
Ivan Pravdin
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-07-05 3:42 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <srmiqb5n6iqsxric6cbkrpinsfcblpowhpijfzjjakiyhs4och@2vrutii673vc>
2025-07-05 3:42 ` [syzbot] [ocfs2?] possible deadlock in __ocfs2_flush_truncate_log syzbot
[not found] <kl7jac3bqyd3dz4uj5rp3dwam6rdbegvf5qahgn7njdaeodndj@aq7yil27yawv>
2025-07-05 3:06 ` syzbot
2025-07-05 3:10 ` Ivan Pravdin
2025-07-05 3:12 ` syzbot
2025-03-15 11:28 syzbot
2025-07-05 3:03 ` syzbot
2025-07-05 3:16 ` syzbot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.