INFO: task kworker/0:1:10 blocked for more than 143 seconds.
      Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/0:1     state:D stack:19368 pid:10    tgid:10    ppid:2      task_flags:0x4208060 flags:0x00004000
Workqueue: bcachefs_write_ref bch2_do_discards_work
Call Trace:
 <TASK>
 __schedule+0x1798/0x4cc0
 schedule+0x165/0x360
 __closure_sync+0x163/0x220
 bch2_journal_res_get_slowpath+0xa04/0xaf0
 bch2_journal_res_get+0x206/0x8f0
 bch2_trans_commit_error+0x361/0x1130
 __bch2_trans_commit+0x1bb5/0x8870
 bch2_discard_one_bucket+0xa32/0x11a0
 bch2_do_discards_work+0x3b3/0x9c0
 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 kworker/1:5:9641 blocked for more than 143 seconds.
      Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/1:5     state:D stack:18816 pid:9641  tgid:9641  ppid:2      task_flags:0x4208060 flags:0x00004000
Workqueue: bcachefs_write_ref bch2_do_discards_fast_work
Call Trace:
 <TASK>
 __schedule+0x1798/0x4cc0
 schedule+0x165/0x360
 __closure_sync+0x163/0x220
 bch2_journal_res_get_slowpath+0xa04/0xaf0
 bch2_journal_res_get+0x206/0x8f0
 bch2_trans_commit_error+0x361/0x1130
 __bch2_trans_commit+0x1bb5/0x8870
 bch2_discard_one_bucket+0xa32/0x11a0
 bch2_do_discards_fast_work+0x522/0xb40
 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 kworker/0:0H:16951 blocked for more than 143 seconds.
      Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/0:0H    state:D stack:22952 pid:16951 tgid:16951 ppid:2      task_flags:0x4208060 flags:0x00004000
Workqueue: bcachefs_btree_write_complete btree_node_write_work
Call Trace:
 <TASK>
 __schedule+0x1798/0x4cc0
 schedule+0x165/0x360
 __closure_sync+0x163/0x220
 bch2_journal_res_get_slowpath+0xa04/0xaf0
 bch2_journal_res_get+0x206/0x8f0
 bch2_trans_commit_error+0x361/0x1130
 __bch2_trans_commit+0x1bb5/0x8870
 bch2_btree_node_update_key+0x1ab7/0x3030
 bch2_btree_node_update_key_get_iter+0x5ad/0x640
 btree_node_write_work+0x763/0xc40
 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.3.2787:18847 blocked for more than 143 seconds.
      Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.3.2787      state:D stack:14056 pid:18847 tgid:18846 ppid:18248  task_flags:0x400140 flags:0x00004006
Call Trace:
 <TASK>
 __schedule+0x1798/0x4cc0
 schedule+0x165/0x360
 __closure_sync+0x163/0x220
 bch2_journal_flush_pins+0x18e/0x250
 bch2_journal_replay+0x2327/0x2630
 __bch2_run_recovery_passes+0x3bd/0x1060
 bch2_run_recovery_passes+0x184/0x210
 bch2_fs_recovery+0x2690/0x3a50
 bch2_fs_start+0xaaf/0xda0
 bch2_fs_get_tree+0xb39/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:0x7fa0a599038a
RSP: 002b:00007fa0a672fe68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fa0a672fef0 RCX: 00007fa0a599038a
RDX: 0000200000000040 RSI: 0000200000000080 RDI: 00007fa0a672feb0
RBP: 0000200000000040 R08: 00007fa0a672fef0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000000080
R13: 00007fa0a672feb0 R14: 0000000000024c72 R15: 0000200000000280
 </TASK>

Showing all locks held in the system:
2 locks held by kworker/0:1/10:
 #0: ffff88801f777d48 ((wq_completion)bcachefs_write_ref){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc900000d7bc0 ((work_completion)(&ca->discard_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
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/5676:
 #0: ffff88810eae00a0 (&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
2 locks held by kworker/1:5/9641:
 #0: ffff88801f777d48 ((wq_completion)bcachefs_write_ref){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc9000301fbc0 ((work_completion)(&ca->discard_fast_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
3 locks held by kworker/u8:5/11164:
 #0: ffff8880213ae948 ((wq_completion)ipv6_addrconf){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc90003cefbc0 ((work_completion)(&(&net->ipv6.addr_chk_work)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
 #2: ffffffff8f538888 (rtnl_mutex){+.+.}-{4:4}, at: addrconf_verify_work+0x19/0x30
3 locks held by kworker/u10:8/12518:
 #0: ffff88801a489148 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc90002aafbc0 ((linkwatch_work).work){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
 #2: ffffffff8f538888 (rtnl_mutex){+.+.}-{4:4}, at: linkwatch_event+0xe/0x60
2 locks held by kworker/0:0H/16951:
 #0: ffff888038da5948 ((wq_completion)bcachefs_btree_write_complete){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc90002f9fbc0 ((work_completion)(&wb->work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
2 locks held by syz.6.3662/21881:
 #0: ffffffff8f538888 (rtnl_mutex){+.+.}-{4:4}, at: tun_chr_close+0x3e/0x1c0
 #1: ffffffff8e13f978 (rcu_state.exp_mutex){+.+.}-{4:4}, at: synchronize_rcu_expedited+0x2f6/0x730
2 locks held by syz.0.3671/21933:
 #0: ffffffff8f59deb0 (cb_lock){++++}-{4:4}, at: genl_rcv+0x19/0x40
 #1: ffffffff8f538888 (rtnl_mutex){+.+.}-{4:4}, at: nl80211_pre_doit+0x5f/0x930
1 lock held by syz.1.3674/21945:
 #0: ffffffff8f538888 (rtnl_mutex){+.+.}-{4:4}, at: rtnetlink_rcv_msg+0x71c/0xb70
1 lock held by syz.1.3674/21946:
 #0: ffff88811b49a428 (sb_writers#5){.+.+}-{0:0}, at: do_splice+0xbff/0x1660

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

NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 34 Comm: khungtaskd Not tainted syzkaller #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 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
RIP: 0010:pv_native_safe_halt+0x13/0x20
Code: 53 e7 02 00 cc cc cc 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa eb 07 0f 00 2d f3 86 0e 00 f3 0f 1e fa fb f4 <c3> cc cc cc cc cc cc cc cc cc cc cc cc 90 90 90 90 90 90 90 90 90
RSP: 0018:ffffc90000177de0 EFLAGS: 00000282
RAX: 5bd52592939c8500 RBX: ffffffff819683c8 RCX: 5bd52592939c8500
RDX: 0000000000000001 RSI: ffffffff8d9b77e3 RDI: ffffffff8be33680
RBP: ffffc90000177f20 R08: ffff888136632f9b R09: 1ffff11026cc65f3
R10: dffffc0000000000 R11: ffffed1026cc65f4 R12: ffffffff8fa38a30
R13: 0000000000000001 R14: 0000000000000001 R15: 1ffff1102001f000
FS:  0000000000000000(0000) GS:ffff8881a3c1b000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000056154e71a000 CR3: 0000000106b5c000 CR4: 00000000000006f0
Call Trace:
 <TASK>
 default_idle+0x13/0x20
 default_idle_call+0x74/0xb0
 do_idle+0x1e8/0x510
 cpu_startup_entry+0x44/0x60
 start_secondary+0x101/0x110
 common_startup_64+0x13e/0x147
 </TASK>
