Kernel bug: INFO: task hung in do_get_write_access (3)
Subsystem: ext4
Status: open

Crash report:
INFO: task kworker/u8:4:63 blocked for more than 143 seconds.
      Not tainted 6.15.0-rc4-syzkaller-00042-gb6ea1680d0ac #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u8:4    state:D stack:23928 pid:63    tgid:63    ppid:2      task_flags:0x4248060 flags:0x00004000
Workqueue: writeback wb_workfn (flush-8:0)
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5382 [inline]
 __schedule+0x116f/0x5de0 kernel/sched/core.c:6767
 __schedule_loop kernel/sched/core.c:6845 [inline]
 schedule+0xe7/0x3a0 kernel/sched/core.c:6860
 io_schedule+0xbf/0x130 kernel/sched/core.c:7742
 bit_wait_io+0x15/0xe0 kernel/sched/wait_bit.c:247
 __wait_on_bit_lock+0x112/0x1a0 kernel/sched/wait_bit.c:90
 out_of_line_wait_on_bit_lock+0xd9/0x110 kernel/sched/wait_bit.c:117
 wait_on_bit_lock_io include/linux/wait_bit.h:221 [inline]
 __lock_buffer+0x67/0x70 fs/buffer.c:71
 lock_buffer include/linux/buffer_head.h:434 [inline]
 do_get_write_access+0x8cd/0x12a0 fs/jbd2/transaction.c:968
 jbd2_journal_get_write_access+0x1d6/0x280 fs/jbd2/transaction.c:1241
 __ext4_journal_get_write_access+0x6a/0x340 fs/ext4/ext4_jbd2.c:241
 ext4_mb_mark_context+0x175/0xd40 fs/ext4/mballoc.c:4001
 ext4_mb_mark_diskspace_used+0x466/0x8c0 fs/ext4/mballoc.c:4131
 ext4_mb_new_blocks+0xa5b/0x4f00 fs/ext4/mballoc.c:6233
 ext4_ext_map_blocks+0x1b95/0x5d60 fs/ext4/extents.c:4379
 ext4_map_create_blocks fs/ext4/inode.c:520 [inline]
 ext4_map_blocks+0x45b/0x1390 fs/ext4/inode.c:706
 mpage_map_one_extent fs/ext4/inode.c:2224 [inline]
 mpage_map_and_submit_extent fs/ext4/inode.c:2277 [inline]
 ext4_do_writepages+0x1a2c/0x3490 fs/ext4/inode.c:2739
 ext4_writepages+0x37a/0x7d0 fs/ext4/inode.c:2829
 do_writepages+0x1b2/0x820 mm/page-writeback.c:2656
 __writeback_single_inode+0x160/0xfb0 fs/fs-writeback.c:1680
 writeback_sb_inodes+0x601/0xf90 fs/fs-writeback.c:1976
 __writeback_inodes_wb+0xf8/0x2d0 fs/fs-writeback.c:2047
 wb_writeback+0x7f3/0xb70 fs/fs-writeback.c:2158
 wb_check_old_data_flush fs/fs-writeback.c:2262 [inline]
 wb_do_writeback fs/fs-writeback.c:2315 [inline]
 wb_workfn+0x8ca/0xbe0 fs/fs-writeback.c:2343
 process_one_work+0x9cc/0x1b70 kernel/workqueue.c:3238
 process_scheduled_works kernel/workqueue.c:3319 [inline]
 worker_thread+0x6c8/0xf10 kernel/workqueue.c:3400
 kthread+0x3c2/0x780 kernel/kthread.c:464
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:153
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>
INFO: task jbd2/sda1-8:5162 blocked for more than 144 seconds.
      Not tainted 6.15.0-rc4-syzkaller-00042-gb6ea1680d0ac #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:jbd2/sda1-8     state:D stack:27336 pid:5162  tgid:5162  ppid:2      task_flags:0x240040 flags:0x00004000
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5382 [inline]
 __schedule+0x116f/0x5de0 kernel/sched/core.c:6767
 __schedule_loop kernel/sched/core.c:6845 [inline]
 schedule+0xe7/0x3a0 kernel/sched/core.c:6860
 io_schedule+0xbf/0x130 kernel/sched/core.c:7742
 bit_wait_io+0x15/0xe0 kernel/sched/wait_bit.c:247
 __wait_on_bit+0x62/0x180 kernel/sched/wait_bit.c:49
 out_of_line_wait_on_bit+0xd9/0x110 kernel/sched/wait_bit.c:64
 wait_on_bit_io include/linux/wait_bit.h:105 [inline]
 __wait_on_buffer+0x64/0x70 fs/buffer.c:123
 wait_on_buffer include/linux/buffer_head.h:422 [inline]
 jbd2_journal_commit_transaction+0x382e/0x6830 fs/jbd2/commit.c:808
 kjournald2+0x1f4/0x760 fs/jbd2/journal.c:201
 kthread+0x3c2/0x780 kernel/kthread.c:464
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:153
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>

Showing all locks held in the system:
2 locks held by kworker/u8:1/13:
 #0: ffff88801b489148 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x12a2/0x1b70 kernel/workqueue.c:3213
 #1: ffff8880b8523c48 (&per_cpu_ptr(group->pcpu, cpu)->seq){-.-.}-{0:0}, at: psi_task_switch+0x2c1/0x8e0 kernel/sched/psi.c:987
1 lock held by khungtaskd/31:
 #0: ffffffff8e3bf440 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:331 [inline]
 #0: ffffffff8e3bf440 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline]
 #0: ffffffff8e3bf440 (rcu_read_lock){....}-{1:3}, at: debug_show_all_locks+0x36/0x1c0 kernel/locking/lockdep.c:6764
6 locks held by kworker/u8:4/63:
 #0: ffff88801f6b9948 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x12a2/0x1b70 kernel/workqueue.c:3213
 #1: ffffc90001557d18 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x929/0x1b70 kernel/workqueue.c:3214
 #2: ffff88814e89c0e0 (&type->s_umount_key#31){++++}-{4:4}, at: super_trylock_shared+0x1e/0xf0 fs/super.c:562
 #3: ffff88814e89eb98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: do_writepages+0x1b2/0x820 mm/page-writeback.c:2656
 #4: ffff88814e8a0950 (jbd2_handle){.+.+}-{0:0}, at: start_this_handle+0x5e4/0x1410 fs/jbd2/transaction.c:444
 #5: ffff88807cbf0cb0 (&ei->i_data_sem){++++}-{4:4}, at: ext4_map_blocks+0x355/0x1390 fs/ext4/inode.c:705
2 locks held by getty/5581:
 #0: ffff88814d60e0a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x24/0x80 drivers/tty/tty_ldisc.c:243
 #1: ffffc9000333b2f0 (&ldata->atomic_read_lock){+.+.}-{4:4}, at: n_tty_read+0x41b/0x14f0 drivers/tty/n_tty.c:2222
1 lock held by syz-executor624/17749:
 #0: ffff8880b8439f18 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x29/0x130 kernel/sched/core.c:605

=============================================

NMI backtrace for cpu 1
CPU: 1 UID: 0 PID: 31 Comm: khungtaskd Not tainted 6.15.0-rc4-syzkaller-00042-gb6ea1680d0ac #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
 nmi_cpu_backtrace+0x27b/0x390 lib/nmi_backtrace.c:113
 nmi_trigger_cpumask_backtrace+0x29c/0x300 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:158 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:274 [inline]
 watchdog+0xf70/0x12c0 kernel/hung_task.c:437
 kthread+0x3c2/0x780 kernel/kthread.c:464
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:153
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 17756 Comm: syz-executor624 Not tainted 6.15.0-rc4-syzkaller-00042-gb6ea1680d0ac #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025
RIP: 0010:fpregs_state_valid arch/x86/kernel/fpu/context.h:38 [inline]
RIP: 0010:fpregs_restore_userregs arch/x86/kernel/fpu/context.h:62 [inline]
RIP: 0010:switch_fpu_return+0x6e/0x1b0 arch/x86/kernel/fpu/core.c:796
Code: 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 27 01 00 00 8b 6b 2c 31 ff 81 e5 00 40 20 00 89 ee e8 aa 10 5b 00 85 ed 0f 85 f9 00 00 00 <e8> 5d 15 5b 00 65 48 8b 05 cd c6 43 12 49 39 c4 0f 84 a6 00 00 00
RSP: 0018:ffffc9000f227ee0 EFLAGS: 00000046
RAX: 0000000000000000 RBX: ffff888031385a00 RCX: ffffffff815f9576
RDX: ffff888031385a00 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff888031387340
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
FS:  0000555576d22380(0000) GS:ffff8881249ed000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000001 CR3: 000000007c35a000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 arch_exit_work arch/x86/include/asm/entry-common.h:58 [inline]
 arch_exit_to_user_mode_prepare arch/x86/include/asm/entry-common.h:65 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:331 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0x234/0x2a0 kernel/entry/common.c:218
 do_syscall_64+0xda/0x230 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f9c08933a79
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 17 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffeddf41778 EFLAGS: 00000246 ORIG_RAX: 0000000000000014
RAX: 0000000000000002 RBX: 0000000000000000 RCX: 00007f9c08933a79
RDX: 0000000000000006 RSI: 0000200000001d40 RDI: 0000000000000003
RBP: 0000000000069681 R08: 0000000000000006 R09: 0000000000000006
R10: 0000000000000006 R11: 0000000000000246 R12: 00007ffeddf4178c
R13: 431bde82d7b634db R14: 0000000000000001 R15: 0000000000000001
 </TASK>