Kernel bug: INFO: task hung in xfs_buf_item_unpin (2)
Subsystem: xfs
Status: open

Crash report:
INFO: task kworker/u8:1:13 blocked for more than 143 seconds.
      Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u8:1    state:D stack:24616 pid:13    tgid:13    ppid:2      task_flags:0x4248060 flags:0x00004000
Workqueue: xfs-cil/loop2 xlog_cil_push_work
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5357 [inline]
 __schedule+0x16f3/0x4c20 kernel/sched/core.c:6961
 __schedule_loop kernel/sched/core.c:7043 [inline]
 schedule+0x165/0x360 kernel/sched/core.c:7058
 schedule_timeout+0x9a/0x270 kernel/time/sleep_timeout.c:75
 ___down_common kernel/locking/semaphore.c:268 [inline]
 __down_common+0x319/0x6a0 kernel/locking/semaphore.c:293
 down+0x80/0xd0 kernel/locking/semaphore.c:100
 xfs_buf_lock+0x15d/0x4d0 fs/xfs/xfs_buf.c:996
 xfs_buf_item_unpin+0x1d4/0x700 fs/xfs/xfs_buf_item.c:556
 xlog_cil_ail_insert fs/xfs/xfs_log_cil.c:-1 [inline]
 xlog_cil_committed+0x959/0x1040 fs/xfs/xfs_log_cil.c:897
 xlog_cil_push_work+0x1f47/0x2570 fs/xfs/xfs_log_cil.c:1518
 process_one_work kernel/workqueue.c:3236 [inline]
 process_scheduled_works+0xade/0x17b0 kernel/workqueue.c:3319
 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400
 kthread+0x70e/0x8a0 kernel/kthread.c:463
 ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>
INFO: task syz.2.35:6355 blocked for more than 143 seconds.
      Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.2.35        state:D stack:26856 pid:6355  tgid:6314  ppid:5992   task_flags:0x400140 flags:0x00004004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5357 [inline]
 __schedule+0x16f3/0x4c20 kernel/sched/core.c:6961
 __schedule_loop kernel/sched/core.c:7043 [inline]
 schedule+0x165/0x360 kernel/sched/core.c:7058
 schedule_timeout+0x9a/0x270 kernel/time/sleep_timeout.c:75
 do_wait_for_common kernel/sched/completion.c:100 [inline]
 __wait_for_common kernel/sched/completion.c:121 [inline]
 wait_for_common kernel/sched/completion.c:132 [inline]
 wait_for_completion+0x2bf/0x5d0 kernel/sched/completion.c:153
 __flush_workqueue+0x6f7/0x14b0 kernel/workqueue.c:4000
 xlog_cil_push_now fs/xfs/xfs_log_cil.c:1636 [inline]
 xlog_cil_force_seq+0x22a/0x8f0 fs/xfs/xfs_log_cil.c:1838
 xfs_log_force_seq+0x196/0x440 fs/xfs/xfs_log.c:3078
 __xfs_trans_commit+0x7d2/0xbd0 fs/xfs/xfs_trans.c:878
 xfs_trans_commit+0x13e/0x1c0 fs/xfs/xfs_trans.c:927
 xfs_sync_sb_buf+0x134/0x230 fs/xfs/libxfs/xfs_sb.c:1474
 xfs_ioc_setlabel fs/xfs/xfs_ioctl.c:1045 [inline]
 xfs_file_ioctl+0x1573/0x18d0 fs/xfs/xfs_ioctl.c:1202
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:598 [inline]
 __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:584
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f7be032ebe9
RSP: 002b:00007f7bdf97d038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f7be0556090 RCX: 00007f7be032ebe9
RDX: 0000200000000100 RSI: 0000000041009432 RDI: 0000000000000004
RBP: 00007f7be03b1e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f7be0556128 R14: 00007f7be0556090 R15: 00007ffcf725f838
 </TASK>

Showing all locks held in the system:
2 locks held by kworker/0:0/9:
 #0: ffff88805674f538 ((wq_completion)xfs-sync/loop3){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3211 [inline]
 #0: ffff88805674f538 ((wq_completion)xfs-sync/loop3){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0 kernel/workqueue.c:3319
 #1: ffffc900000e7bc0 ((work_completion)(&(&log->l_work)->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3212 [inline]
 #1: ffffc900000e7bc0 ((work_completion)(&(&log->l_work)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0 kernel/workqueue.c:3319
2 locks held by kworker/0:1/10:
 #0: ffff8880213afd38 ((wq_completion)xfs-sync/loop2){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3211 [inline]
 #0: ffff8880213afd38 ((wq_completion)xfs-sync/loop2){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0 kernel/workqueue.c:3319
 #1: ffffc900000f7bc0 ((work_completion)(&(&log->l_work)->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3212 [inline]
 #1: ffffc900000f7bc0 ((work_completion)(&(&log->l_work)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0 kernel/workqueue.c:3319
2 locks held by kworker/u8:1/13:
 #0: ffff888020fa5938 ((wq_completion)xfs-cil/loop2#2){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3211 [inline]
 #0: ffff888020fa5938 ((wq_completion)xfs-cil/loop2#2){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0 kernel/workqueue.c:3319
 #1: ffffc90000127bc0 ((work_completion)(&ctx->push_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3212 [inline]
 #1: ffffc90000127bc0 ((work_completion)(&ctx->push_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0 kernel/workqueue.c:3319
2 locks held by kworker/u8:2/37:
 #0: ffff88805920e938 ((wq_completion)xfs-cil/loop4#11){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3211 [inline]
 #0: ffff88805920e938 ((wq_completion)xfs-cil/loop4#11){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0 kernel/workqueue.c:3319
 #1: ffffc90000ac7bc0 ((work_completion)(&ctx->push_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3212 [inline]
 #1: ffffc90000ac7bc0 ((work_completion)(&ctx->push_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0 kernel/workqueue.c:3319
1 lock held by khungtaskd/39:
 #0: ffffffff8d9a8b80 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:331 [inline]
 #0: ffffffff8d9a8b80 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline]
 #0: ffffffff8d9a8b80 (rcu_read_lock){....}-{1:3}, at: debug_show_all_locks+0x2e/0x180 kernel/locking/lockdep.c:6775
2 locks held by kworker/1:1/44:
 #0: ffff888033cd9d38 ((wq_completion)xfs-sync/loop4){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3211 [inline]
 #0: ffff888033cd9d38 ((wq_completion)xfs-sync/loop4){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0 kernel/workqueue.c:3319
 #1: ffffc90000b57bc0 ((work_completion)(&(&log->l_work)->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3212 [inline]
 #1: ffffc90000b57bc0 ((work_completion)(&(&log->l_work)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0 kernel/workqueue.c:3319
2 locks held by kworker/0:2/914:
 #0: ffff888038fd3938 ((wq_completion)xfs-sync/loop5#22){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3211 [inline]
 #0: ffff888038fd3938 ((wq_completion)xfs-sync/loop5#22){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0 kernel/workqueue.c:3319
 #1: ffffc9000469fbc0 ((work_completion)(&(&log->l_work)->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3212 [inline]
 #1: ffffc9000469fbc0 ((work_completion)(&(&log->l_work)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0 kernel/workqueue.c:3319
2 locks held by kworker/u8:6/1261:
 #0: ffff8880590c4138 ((wq_completion)xfs-cil/loop3#15){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3211 [inline]
 #0: ffff8880590c4138 ((wq_completion)xfs-cil/loop3#15){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0 kernel/workqueue.c:3319
 #1: ffffc90004ff7bc0 ((work_completion)(&ctx->push_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3212 [inline]
 #1: ffffc90004ff7bc0 ((work_completion)(&ctx->push_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0 kernel/workqueue.c:3319
2 locks held by kworker/u8:11/3561:
 #0: ffff888027543138 ((wq_completion)xfs-cil/loop1#21){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3211 [inline]
 #0: ffff888027543138 ((wq_completion)xfs-cil/loop1#21){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0 kernel/workqueue.c:3319
 #1: ffffc9000df6fbc0 ((work_completion)(&ctx->push_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3212 [inline]
 #1: ffffc9000df6fbc0 ((work_completion)(&ctx->push_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0 kernel/workqueue.c:3319
2 locks held by getty/5600:
 #0: ffff88823bf7e8a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70 drivers/tty/tty_ldisc.c:243
 #1: ffffc90003e8b2e0 (&ldata->atomic_read_lock){+.+.}-{4:4}, at: n_tty_read+0x444/0x1410 drivers/tty/n_tty.c:2222
2 locks held by kworker/1:3/5903:
 #0: ffff888037a59d38 ((wq_completion)xfs-sync/loop1){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3211 [inline]
 #0: ffff888037a59d38 ((wq_completion)xfs-sync/loop1){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0 kernel/workqueue.c:3319
 #1: ffffc90004d17bc0 ((work_completion)(&(&log->l_work)->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3212 [inline]
 #1: ffffc90004d17bc0 ((work_completion)(&(&log->l_work)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0 kernel/workqueue.c:3319
1 lock held by udevd/6043:
1 lock held by udevd/6228:
1 lock held by syz.2.35/6355:
 #0: ffff88804686a488 (sb_writers#12){.+.+}-{0:0}, at: mnt_want_write_file+0x63/0x210 fs/namespace.c:601
1 lock held by syz.4.69/6705:
 #0: ffff88805928c488 (sb_writers#12){.+.+}-{0:0}, at: mnt_want_write_file+0x63/0x210 fs/namespace.c:601
2 locks held by kworker/u8:4/6703:
2 locks held by kworker/u8:13/6912:
 #0: ffff888058621938 ((wq_completion)xfs-cil/loop5#22){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3211 [inline]
 #0: ffff888058621938 ((wq_completion)xfs-cil/loop5#22){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0 kernel/workqueue.c:3319
 #1: ffffc900069a7bc0 ((work_completion)(&ctx->push_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3212 [inline]
 #1: ffffc900069a7bc0 ((work_completion)(&ctx->push_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0 kernel/workqueue.c:3319
1 lock held by syz.3.93/6964:
 #0: ffff88803abaa488 (sb_writers#12){.+.+}-{0:0}, at: mnt_want_write_file+0x63/0x210 fs/namespace.c:601
1 lock held by syz.1.111/7178:
 #0: ffff8880289b4488 (sb_writers#12){.+.+}-{0:0}, at: mnt_want_write_file+0x63/0x210 fs/namespace.c:601
1 lock held by syz.5.152/7654:
 #0: ffff88803a9c4488 (sb_writers#12){.+.+}-{0:0}, at: mnt_want_write_file+0x63/0x210 fs/namespace.c:601
1 lock held by syz-executor/7806:
5 locks held by kworker/u8:17/7863:
1 lock held by syz.6.215/8268:
2 locks held by syz.7.216/8291:
2 locks held by syz.0.217/8313:

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

NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 39 Comm: khungtaskd Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 nmi_cpu_backtrace+0x39e/0x3d0 lib/nmi_backtrace.c:113
 nmi_trigger_cpumask_backtrace+0x17a/0x300 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:160 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:328 [inline]
 watchdog+0xf93/0xfe0 kernel/hung_task.c:491
 kthread+0x70e/0x8a0 kernel/kthread.c:463
 ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 UID: 0 PID: 8268 Comm: syz.6.215 Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
RIP: 0010:arch_irqs_disabled_flags arch/x86/include/asm/irqflags.h:146 [inline]
RIP: 0010:lock_acquire+0xf6/0x360 kernel/locking/lockdep.c:5869
Code: 30 4c 89 74 24 10 4d 89 fe 4c 8b 7c 24 30 fa 48 c7 c7 80 b7 04 8d e8 99 6b 5a 09 65 ff 05 02 30 5a 10 45 31 c9 4c 89 7c 24 08 <41> f7 c7 00 02 00 00 41 0f 94 c1 4c 89 ef 89 de 8b 54 24 04 44 89
RSP: 0018:ffffc900102f71d8 EFLAGS: 00000046
RAX: 0000000000000001 RBX: 0000000000000000 RCX: e3f3cd2b2e6a7900
RDX: 0000000000000000 RSI: ffffffff8d04b780 RDI: ffffffff8b620c80
RBP: ffffffff8190cacb R08: 0000000000000001 R09: 0000000000000000
R10: dffffc0000000000 R11: fffffbfff1e3a887 R12: 0000000000000000
R13: ffff8880b893aad8 R14: 0000000000000001 R15: 0000000000000046
FS:  00007f63bb58e6c0(0000) GS:ffff8881269c2000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fe2edbb3000 CR3: 0000000032e0e000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 finish_lock_switch kernel/sched/core.c:5103 [inline]
 finish_task_switch+0x1a0/0x950 kernel/sched/core.c:5223
 context_switch kernel/sched/core.c:5360 [inline]
 __schedule+0x16fb/0x4c20 kernel/sched/core.c:6961
 __schedule_loop kernel/sched/core.c:7043 [inline]
 schedule+0x165/0x360 kernel/sched/core.c:7058
 schedule_timeout+0x12b/0x270 kernel/time/sleep_timeout.c:99
 xfs_pwork_poll+0x16a/0x330 fs/xfs/xfs_pwork.c:118
 xfs_iwalk_threaded+0x4cf/0x580 fs/xfs/xfs_iwalk.c:684
 xfs_qm_quotacheck+0x2b1/0x6e0 fs/xfs/xfs_qm.c:1547
 xfs_qm_mount_quotas+0x26a/0x670 fs/xfs/xfs_qm.c:1689
 xfs_mountfs+0x1b6f/0x2330 fs/xfs/xfs_mount.c:1200
 xfs_fs_fill_super+0x1185/0x15d0 fs/xfs/xfs_super.c:1965
 get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1692
 vfs_get_tree+0x8f/0x2b0 fs/super.c:1815
 do_new_mount+0x2a2/0x9e0 fs/namespace.c:3808
 do_mount fs/namespace.c:4136 [inline]
 __do_sys_mount fs/namespace.c:4347 [inline]
 __se_sys_mount+0x317/0x410 fs/namespace.c:4324
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f63bbf2038a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f63bb58de68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f63bb58def0 RCX: 00007f63bbf2038a
RDX: 0000200000009600 RSI: 0000200000002580 RDI: 00007f63bb58deb0
RBP: 0000200000009600 R08: 00007f63bb58def0 R09: 0000000000a00840
R10: 0000000000a00840 R11: 0000000000000246 R12: 0000200000002580
R13: 00007f63bb58deb0 R14: 000000000000968d R15: 00002000000025c0
 </TASK>