syzbot


possible deadlock in wait_transaction_locked

Status: upstream: reported on 2026/01/23 09:44
Reported-by: syzbot+1c9c6ed72ad8507b9f9b@syzkaller.appspotmail.com
First crash: 1d05h, last: 1d05h
Similar bugs (5)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in wait_transaction_locked ext4 4 3 597d 615d 0/29 auto-obsoleted due to no activity on 2024/09/14 08:21
linux-5.15 possible deadlock in wait_transaction_locked 4 4 1h19m 3d23h 0/3 upstream: reported on 2026/01/20 15:21
upstream possible deadlock in wait_transaction_locked (3) ext4 4 26 55m 25d 0/29 upstream: reported on 2025/12/30 11:48
upstream possible deadlock in wait_transaction_locked (2) ext4 4 1 380d 376d 0/29 auto-obsoleted due to no activity on 2025/04/18 23:41
linux-6.1 possible deadlock in wait_transaction_locked 4 19 3d00h 12d 0/3 upstream: reported on 2026/01/12 10:36

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
kworker/u4:8/2965 is trying to acquire lock:
ffff888020972990 (jbd2_handle){++++}-{0:0}, at: wait_transaction_locked+0x1aa/0x270 fs/jbd2/transaction.c:155

but task is already holding lock:
ffff888020970bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_read fs/ext4/ext4.h:1767 [inline]
ffff888020970bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages+0x1a4/0x350 fs/ext4/inode.c:2806

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&sbi->s_writepages_rwsem
){++++}-{0:0}:
       percpu_down_read+0x44/0x1a0 include/linux/percpu-rwsem.h:51
       ext4_writepages_down_read fs/ext4/ext4.h:1767 [inline]
       ext4_writepages+0x1a4/0x350 fs/ext4/inode.c:2806
       do_writepages+0x3b3/0x630 mm/page-writeback.c:2575
       __writeback_single_inode+0x153/0xec0 fs/fs-writeback.c:1635
       writeback_single_inode+0x21f/0x760 fs/fs-writeback.c:1756
       write_inode_now+0x183/0x210 fs/fs-writeback.c:2802
       iput_final fs/inode.c:1807 [inline]
       iput+0x5ae/0x920 fs/inode.c:1846
       ext4_xattr_block_set+0x273f/0x32b0 fs/ext4/xattr.c:2198
       ext4_xattr_move_to_block fs/ext4/xattr.c:2663 [inline]
       ext4_xattr_make_inode_space fs/ext4/xattr.c:2738 [inline]
       ext4_expand_extra_isize_ea+0x12c5/0x1e80 fs/ext4/xattr.c:2826
       __ext4_expand_extra_isize+0x306/0x400 fs/ext4/inode.c:5971
       ext4_try_to_expand_extra_isize fs/ext4/inode.c:6014 [inline]
       __ext4_mark_inode_dirty+0x45d/0x6e0 fs/ext4/inode.c:6092
       ext4_evict_inode+0x7f3/0xea0 fs/ext4/inode.c:252
       evict+0x4ca/0x8d0 fs/inode.c:705
       ext4_orphan_cleanup+0xbec/0x1420 fs/ext4/orphan.c:472
       __ext4_fill_super fs/ext4/super.c:5617 [inline]
       ext4_fill_super+0x5ed3/0x6790 fs/ext4/super.c:5740
       get_tree_bdev+0x3f3/0x520 fs/super.c:1591
       vfs_get_tree+0x8c/0x280 fs/super.c:1764
       do_new_mount+0x24b/0xa40 fs/namespace.c:3386
       do_mount fs/namespace.c:3726 [inline]
       __do_sys_mount fs/namespace.c:3935 [inline]
       __se_sys_mount+0x2e7/0x3d0 fs/namespace.c:3912
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xa0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #1 (&ei->xattr_sem){++++}-{3:3}:
       down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520
       ext4_setattr+0x86b/0x1ca0 fs/ext4/inode.c:5494
       notify_change+0xb0d/0xe10 fs/attr.c:499
       chown_common+0x413/0x5d0 fs/open.c:783
       do_fchownat+0x14b/0x240 fs/open.c:814
       __do_sys_chown fs/open.c:834 [inline]
       __se_sys_chown fs/open.c:832 [inline]
       __x64_sys_chown+0x82/0x90 fs/open.c:832
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xa0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (jbd2_handle){++++}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3134 [inline]
       check_prevs_add kernel/locking/lockdep.c:3253 [inline]
       validate_chain kernel/locking/lockdep.c:3869 [inline]
       __lock_acquire+0x2df1/0x7d40 kernel/locking/lockdep.c:5137
       lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754
       wait_transaction_locked+0x1c3/0x270 fs/jbd2/transaction.c:155
       add_transaction_credits fs/jbd2/transaction.c:226 [inline]
       start_this_handle+0x7e8/0x21c0 fs/jbd2/transaction.c:407
       jbd2__journal_start+0x2bb/0x5b0 fs/jbd2/transaction.c:505
       __ext4_journal_start_sb+0x203/0x560 fs/ext4/ext4_jbd2.c:112
       __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline]
       ext4_do_writepages+0xfb7/0x3990 fs/ext4/inode.c:2701
       ext4_writepages+0x1dd/0x350 fs/ext4/inode.c:2807
       do_writepages+0x3b3/0x630 mm/page-writeback.c:2575
       __writeback_single_inode+0x153/0xec0 fs/fs-writeback.c:1635
       writeback_sb_inodes+0x7cd/0xf50 fs/fs-writeback.c:1926
       __writeback_inodes_wb+0x111/0x240 fs/fs-writeback.c:1997
       wb_writeback+0x47e/0xbf0 fs/fs-writeback.c:2107
       wb_check_old_data_flush fs/fs-writeback.c:2211 [inline]
       wb_do_writeback fs/fs-writeback.c:2264 [inline]
       wb_workfn+0xad7/0xe60 fs/fs-writeback.c:2292
       process_one_work kernel/workqueue.c:2634 [inline]
       process_scheduled_works+0xa5d/0x15d0 kernel/workqueue.c:2711
       worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792
       kthread+0x2fa/0x390 kernel/kthread.c:388
       ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
       ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293

other info that might help us debug this:

Chain exists of:
  jbd2_handle --> 
&ei->xattr_sem --> &sbi->s_writepages_rwsem

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  rlock(&sbi->s_writepages_rwsem);
                               lock(&ei->xattr_sem);
                               lock(&sbi->s_writepages_rwsem);
  lock(jbd2_handle);

 *** DEADLOCK ***

4 locks held by kworker/u4:8/2965:
 #0: ffff888142a40538 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2609 [inline]
 #0: ffff888142a40538 ((wq_completion)writeback){+.+.}-{0:0}, at: process_scheduled_works+0x96f/0x15d0 kernel/workqueue.c:2711
 #1: ffffc9000c24fd00 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2609 [inline]
 #1: ffffc9000c24fd00 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x96f/0x15d0 kernel/workqueue.c:2711
 #2: ffff8880208be0e0 (&type->s_umount_key#32){++++}-{3:3}, at: super_trylock_shared+0x20/0xf0 fs/super.c:607
 #3: ffff888020970bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_read fs/ext4/ext4.h:1767 [inline]
 #3: ffff888020970bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages+0x1a4/0x350 fs/ext4/inode.c:2806

stack backtrace:
CPU: 1 PID: 2965 Comm: kworker/u4:8 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Workqueue: writeback wb_workfn (flush-8:0)
Call Trace:
 <TASK>
 dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
 check_noncircular+0x2fc/0x400 kernel/locking/lockdep.c:2187
 check_prev_add kernel/locking/lockdep.c:3134 [inline]
 check_prevs_add kernel/locking/lockdep.c:3253 [inline]
 validate_chain kernel/locking/lockdep.c:3869 [inline]
 __lock_acquire+0x2df1/0x7d40 kernel/locking/lockdep.c:5137
 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754
 wait_transaction_locked+0x1c3/0x270 fs/jbd2/transaction.c:155
 add_transaction_credits fs/jbd2/transaction.c:226 [inline]
 start_this_handle+0x7e8/0x21c0 fs/jbd2/transaction.c:407
 jbd2__journal_start+0x2bb/0x5b0 fs/jbd2/transaction.c:505
 __ext4_journal_start_sb+0x203/0x560 fs/ext4/ext4_jbd2.c:112
 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline]
 ext4_do_writepages+0xfb7/0x3990 fs/ext4/inode.c:2701
 ext4_writepages+0x1dd/0x350 fs/ext4/inode.c:2807
 do_writepages+0x3b3/0x630 mm/page-writeback.c:2575
 __writeback_single_inode+0x153/0xec0 fs/fs-writeback.c:1635
 writeback_sb_inodes+0x7cd/0xf50 fs/fs-writeback.c:1926
 __writeback_inodes_wb+0x111/0x240 fs/fs-writeback.c:1997
 wb_writeback+0x47e/0xbf0 fs/fs-writeback.c:2107
 wb_check_old_data_flush fs/fs-writeback.c:2211 [inline]
 wb_do_writeback fs/fs-writeback.c:2264 [inline]
 wb_workfn+0xad7/0xe60 fs/fs-writeback.c:2292
 process_one_work kernel/workqueue.c:2634 [inline]
 process_scheduled_works+0xa5d/0x15d0 kernel/workqueue.c:2711
 worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792
 kthread+0x2fa/0x390 kernel/kthread.c:388
 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/01/23 09:43 linux-6.6.y cbb31f77b879 e2b1b6e6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in wait_transaction_locked
* Struck through repros no longer work on HEAD.