INFO: task kworker/1:1H:60 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:1H    state:D stack:19752 pid:60    tgid:60    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+0x439/0x7d0
 ret_from_fork_asm+0x1a/0x30
 </TASK>
INFO: task kworker/1:5:6336 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:16712 pid:6336  tgid:6336  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+0x439/0x7d0
 ret_from_fork_asm+0x1a/0x30
 </TASK>
INFO: task syz.3.976:16322 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.976       state:D stack:14016 pid:16322 tgid:16276 ppid:13253  task_flags:0x400040 flags:0x00004006
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_inode_delete_keys+0x525/0x700
 bch2_inode_rm+0x282/0x820
 bch2_evict_inode+0x220/0x520
 evict+0x504/0x9c0
 __dentry_kill+0x209/0x660
 dput+0x19f/0x2b0
 __fput+0x68e/0xa70
 task_work_run+0x1d4/0x260
 get_signal+0x11ed/0x1340
 arch_do_signal_or_restart+0x9a/0x750
 exit_to_user_mode_loop+0x75/0x110
 do_syscall_64+0x2bd/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f70b678ec29
RSP: 002b:00007f70b75cd038 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: 0000000000107000 RBX: 00007f70b69d6090 RCX: 00007f70b678ec29
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000004
RBP: 00007f70b6811e41 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000020fffe82 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f70b69d6128 R14: 00007f70b69d6090 R15: 00007ffc594881b8
 </TASK>

Showing all locks held in the system:
1 lock held by khungtaskd/34:
 #0: ffffffff8e13a0e0 (rcu_read_lock){....}-{1:3}, at: debug_show_all_locks+0x2e/0x180
2 locks held by kworker/1:1H/60:
 #0: ffff888118ec6148 ((wq_completion)bcachefs_btree_write_complete){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc90000edfbc0 ((work_completion)(&wb->work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
2 locks held by syslogd/5280:
 #0: ffff88804b039f98 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2a/0x140
 #1: ffff88804b024008 (psi_seq){-.-.}-{0:0}, at: psi_task_switch+0x53/0x880
3 locks held by kworker/0:3/5316:
 #0: ffff88801a480d48 ((wq_completion)events){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc90001b8fbc0 ((work_completion)(&data->fib_event_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
 #2: ffff88803dfc5240 (&data->fib_lock){+.+.}-{4:4}, at: nsim_fib_event_work+0x26b/0x3180
2 locks held by getty/5678:
 #0: ffff8880285900a0 (&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/6336:
 #0: ffff8880356dbd48 ((wq_completion)bcachefs_write_ref){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc900034bfbc0 ((work_completion)(&ca->discard_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
2 locks held by syz.3.1352/19670:
 #0: ffff888104caa0e0 (&type->s_umount_key#67){++++}-{4:4}, at: super_lock+0x2a9/0x3b0
 #1: ffff88810f584398 (&c->btree_trans_barrier){.+.+}-{0:0}, at: __bch2_trans_get+0x7f4/0xd80
5 locks held by syz.0.1366/19873:
2 locks held by dhcpcd-run-hook/19892:

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

NMI backtrace for cpu 1
CPU: 1 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+0x439/0x7d0
 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: 6797 Comm: kworker/u8:6 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
Workqueue: bat_events batadv_nc_worker
RIP: 0010:mark_lock+0x3c/0x190
Code: 00 03 00 83 f9 01 bb 09 00 00 00 83 db 00 83 fa 08 0f 45 da bd 01 00 00 00 89 d9 d3 e5 25 ff 1f 00 00 48 0f a3 05 04 16 0b 12 <73> 10 48 69 c0 c8 00 00 00 48 8d 88 10 a3 49 93 eb 48 83 3d 6b a5
RSP: 0018:ffffc900035ff868 EFLAGS: 00000007
RAX: 0000000000000784 RBX: 0000000000000002 RCX: 0000000000000002
RDX: 0000000000000002 RSI: ffff8881074f0af0 RDI: ffff8881074f0000
RBP: 0000000000000004 R08: ffffffff8fa3a737 R09: 1ffffffff1f474e6
R10: dffffc0000000000 R11: fffffbfff1f474e7 R12: ffff8881074f0af0
R13: dffffc0000000000 R14: ffff8881074f0af0 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff8880b8612000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ff8d4303378 CR3: 000000010e892000 CR4: 00000000000006f0
Call Trace:
 <TASK>
 lockdep_hardirqs_on_prepare+0x129/0x2a0
 trace_hardirqs_on+0x28/0x40
 __local_bh_enable_ip+0x12d/0x1c0
 batadv_nc_purge_paths+0x318/0x3b0
 batadv_nc_worker+0x369/0x610
 process_scheduled_works+0xae1/0x17b0
 worker_thread+0x8a0/0xda0
 kthread+0x711/0x8a0
 ret_from_fork+0x439/0x7d0
 ret_from_fork_asm+0x1a/0x30
 </TASK>
