INFO: task kworker/u9:3:2165 blocked for more than 143 seconds.
      Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u9:3    state:D stack:19304 pid:2165  tgid:2165  ppid:2      task_flags:0x4208060 flags:0x00004000
Workqueue: btree_update btree_interior_update_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
 btree_interior_update_work+0x1082/0x27d0
 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:7:10382 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:7     state:D stack:22936 pid:10382 tgid:10382 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>

Showing all locks held in the system:
1 lock held by khungtaskd/34:
 #0: ffffffff8e139f20 (rcu_read_lock){....}-{1:3}, at: debug_show_all_locks+0x2e/0x180
2 locks held by kworker/u9:3/2165:
 #0: ffff88802844c148 ((wq_completion)btree_update){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc9000a897bc0 ((work_completion)(&c->btree_interior_update_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
2 locks held by getty/5679:
 #0: ffff8880200e50a0 (&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 syz-executor/10234:
 #0: ffff88811e9640e0 (&type->s_umount_key#58){++++}-{4:4}, at: deactivate_super+0xa9/0xe0
 #1: ffff888045780278 (&c->state_lock){++++}-{4:4}, at: __bch2_fs_stop+0xf8/0x900
2 locks held by kworker/0:7/10382:
 #0: ffff8880461dad48 ((wq_completion)bcachefs_write_ref){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc900036bfbc0 ((work_completion)(&ca->discard_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
1 lock held by syz.2.627/11463:
 #0: ffff88811e9640e0 (&type->s_umount_key#58){++++}-{4:4}, at: super_lock+0x2a9/0x3b0
2 locks held by syz.5.1026/14490:
3 locks held by syz.6.1025/14492:

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

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: 14492 Comm: syz.6.1025 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:__lock_acquire+0xfb/0xd20
Code: 6c 24 10 44 8b b4 24 88 00 00 00 8b 6c 24 78 41 89 d5 48 c7 c1 10 43 49 93 48 29 c8 48 c1 f8 03 48 be 29 5c 8f c2 f5 28 5c 8f <48> 0f af f0 45 85 f6 0f 85 4a 01 00 00 45 85 ed 0f 84 41 01 00 00
RSP: 0018:ffffc9000360ef28 EFLAGS: 00000006
RAX: 00000000000000af RBX: ffffffff8e139f20 RCX: ffffffff93494310
RDX: 0000000000000001 RSI: 8f5c28f5c28f5c29 RDI: ffff8881089d0000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: ffffc9000360f178 R11: ffffffff81ac3aa0 R12: 0000000000000002
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000000
FS:  00007facff3566c0(0000) GS:ffff8881a3c18000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f8dfc11c108 CR3: 000000011ac84000 CR4: 00000000000006f0
Call Trace:
 <TASK>
 lock_acquire+0x120/0x360
 unwind_next_frame+0xc2/0x2390
 arch_stack_walk+0x11c/0x150
 stack_trace_save+0x9c/0xe0
 save_stack+0xf5/0x1f0
 __reset_page_owner+0x71/0x1f0
 free_unref_folios+0xdbd/0x1520
 folios_put_refs+0x559/0x640
 free_pages_and_swap_cache+0x277/0x520
 tlb_flush_mmu+0x3a0/0x680
 tlb_finish_mmu+0xc3/0x1d0
 vms_clear_ptes+0x42c/0x540
 vms_complete_munmap_vmas+0x206/0x8a0
 do_vmi_align_munmap+0x358/0x420
 do_vmi_munmap+0x253/0x2e0
 __vm_munmap+0x23b/0x3d0
 __x64_sys_munmap+0x60/0x70
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7facfe58ec77
Code: 00 00 00 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 0b 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:00007facff355e18 EFLAGS: 00000246 ORIG_RAX: 000000000000000b
RAX: ffffffffffffffda RBX: 0000000001000000 RCX: 00007facfe58ec77
RDX: 0000000000000000 RSI: 0000000008400000 RDI: 00007facf4200000
RBP: 0000000000000000 R08: 0000000000000000 R09: 000000000000967a
R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000004
R13: 00007facff355ef0 R14: 00007facff355eb0 R15: 00007facf4200000
 </TASK>
