INFO: task kworker/0:4:5879 blocked for more than 143 seconds.
      Not tainted 6.16.0-syzkaller-11895-gcca7a0aae895 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/0:4     state:D stack:20984 pid:5879  tgid:5879  ppid:2      task_flags:0x4208060 flags:0x00004000
Workqueue: events_long bch2_fs_read_only_work
Call Trace:
 <TASK>
 __schedule+0x1798/0x4cc0
 schedule+0x165/0x360
 schedule_timeout+0x9a/0x270
 wait_for_completion+0x2bf/0x5d0
 kthread_stop+0x194/0x5c0
 bch2_copygc_stop+0x4b/0x120
 __bch2_fs_read_only+0x47/0x5b0
 bch2_fs_read_only+0x42a/0xb00
 bch2_fs_read_only_work+0x2d/0x40
 process_scheduled_works+0xae1/0x17b0
 worker_thread+0x8a0/0xda0
 kthread+0x711/0x8a0
 ret_from_fork+0x3fc/0x770
 ret_from_fork_asm+0x1a/0x30
 </TASK>
INFO: task syz.1.754:10268 blocked for more than 143 seconds.
      Not tainted 6.16.0-syzkaller-11895-gcca7a0aae895 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.1.754       state:D stack:15112 pid:10268 tgid:10267 ppid:5847   task_flags:0x400140 flags:0x00004006
Call Trace:
 <TASK>
 __schedule+0x1798/0x4cc0
 schedule+0x165/0x360
 schedule_preempt_disabled+0x13/0x30
 rwsem_down_write_slowpath+0x872/0xfe0
 down_write+0x1ab/0x1f0
 __bch2_fs_stop+0xf8/0x900
 bch2_fs_stop+0x15/0x20
 bch2_fs_get_tree+0xb6e/0x1520
 vfs_get_tree+0x92/0x2b0
 do_new_mount+0x2a2/0x9e0
 __se_sys_mount+0x317/0x410
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5312f9038a
RSP: 002b:00007f5313e80e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f5313e80ef0 RCX: 00007f5312f9038a
RDX: 00002000000000c0 RSI: 0000200000000040 RDI: 00007f5313e80eb0
RBP: 00002000000000c0 R08: 00007f5313e80ef0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000000040
R13: 00007f5313e80eb0 R14: 0000000000005922 R15: 0000200000000000
 </TASK>

Showing all locks held in the system:
3 locks held by kworker/1:0/24:
 #0: ffff88801a481948 ((wq_completion)events_long){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc900001c7bc0 ((work_completion)(&c->read_only_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
 #2: ffff888033400278 (&c->state_lock){++++}-{4:4}, at: bch2_fs_read_only_work+0x25/0x40
1 lock held by khungtaskd/34:
 #0: ffffffff8e139ee0 (rcu_read_lock){....}-{1:3}, at: debug_show_all_locks+0x2e/0x180
2 locks held by getty/5670:
 #0: ffff888029f6d0a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70
 #1: ffffc900029062f0 (&ldata->atomic_read_lock){+.+.}-{4:4}, at: n_tty_read+0x43e/0x1400
3 locks held by kworker/0:4/5879:
 #0: ffff88801a481948 ((wq_completion)events_long){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc90003d7fbc0 ((work_completion)(&c->read_only_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
 #2: ffff888114200278 (&c->state_lock){++++}-{4:4}, at: bch2_fs_read_only_work+0x25/0x40
1 lock held by syz.1.754/10268:
 #0: ffff888114200278 (&c->state_lock){++++}-{4:4}, at: __bch2_fs_stop+0xf8/0x900
1 lock held by syz.5.1020/12114:
 #0: ffff888033400278 (&c->state_lock){++++}-{4:4}, at: __bch2_fs_stop+0xf8/0x900

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

NMI backtrace for cpu 1
CPU: 1 UID: 0 PID: 34 Comm: khungtaskd Not tainted 6.16.0-syzkaller-11895-gcca7a0aae895 #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250
 nmi_cpu_backtrace+0x39e/0x3d0
 nmi_trigger_cpumask_backtrace+0x17a/0x300
 watchdog+0xf93/0xfe0
 kthread+0x711/0x8a0
 ret_from_fork+0x3fc/0x770
 ret_from_fork_asm+0x1a/0x30
 </TASK>
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 83 Comm: kworker/u9:3 Not tainted 6.16.0-syzkaller-11895-gcca7a0aae895 #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Workqueue: events_unbound toggle_allocation_gate
RIP: 0010:__sanitizer_cov_trace_pc+0x31/0x70
Code: 24 65 48 8b 0c 25 08 c0 9f 92 65 8b 15 68 14 e0 10 81 e2 00 01 ff 00 74 11 81 fa 00 01 00 00 75 35 83 b9 3c 16 00 00 00 74 2c <8b> 91 18 16 00 00 83 fa 02 75 21 48 8b 91 20 16 00 00 48 8b 32 48
RSP: 0018:ffffc90001c0f600 EFLAGS: 00000246
RAX: ffffffff820fedfb RBX: 00002aaaaaaab000 RCX: ffff88801ec31cc0
RDX: 0000000000000000 RSI: ffffffff8be325e0 RDI: ffffffff8be325a0
RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffff820fedb9
R10: dffffc0000000000 R11: fffff94000010c31 R12: ffffffff821865f8
R13: fffffffffffffeff R14: ffff88801a474aa8 R15: ffffc90001c0f678
FS:  0000000000000000(0000) GS:ffff8880b8624000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000558f7ec8b000 CR3: 000000000df36000 CR4: 00000000000006f0
Call Trace:
 <TASK>
 ___pte_offset_map+0x6b/0x250
 __pte_offset_map_lock+0x46/0x210
 __text_poke+0x2e6/0xa10
 smp_text_poke_batch_finish+0xd0f/0x1130
 arch_jump_label_transform_apply+0x1c/0x30
 static_key_enable_cpuslocked+0x128/0x250
 static_key_enable+0x1a/0x20
 toggle_allocation_gate+0xad/0x240
 process_scheduled_works+0xae1/0x17b0
 worker_thread+0x8a0/0xda0
 kthread+0x711/0x8a0
 ret_from_fork+0x3fc/0x770
 ret_from_fork_asm+0x1a/0x30
 </TASK>
