INFO: task bch-reclaim/loo:6954 blocked for more than 143 seconds.
      Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:bch-reclaim/loo state:D stack:18600 pid:6954  tgid:6954  ppid:2      task_flags:0x200040 flags:0x00004000
Call Trace:
 <TASK>
 __schedule+0x1798/0x4cc0
 schedule+0x165/0x360
 schedule_preempt_disabled+0x13/0x30
 __mutex_lock+0x7e6/0x1350
 bch2_journal_reclaim_thread+0x16b/0x4f0
 kthread+0x711/0x8a0
 ret_from_fork+0x3fc/0x770
 ret_from_fork_asm+0x1a/0x30
 </TASK>

Showing all locks held in the system:
3 locks held by kworker/1:0/24:
 #0: ffff88801a480d48 ((wq_completion)events){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc900001c7bc0 ((work_completion)(&data->fib_event_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
 #2: ffff888042c7e240 (&data->fib_lock){+.+.}-{4:4}, at: nsim_fib_event_work+0x26b/0x3180
4 locks held by kworker/u9:1/29:
 #0: ffff8881199ad948 ((wq_completion)btree_update#4){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc9000062fbc0 ((work_completion)(&c->btree_interior_update_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
 #2: ffff888117104398 (&c->btree_trans_barrier){.+.+}-{0:0}, at: bch2_trans_srcu_lock+0xaf/0x220
 #3: ffff888117126710 (&c->gc_lock){++++}-{4:4}, at: bch2_btree_update_start+0x542/0x1de0
1 lock held by khungtaskd/34:
 #0: ffffffff8e139f20 (rcu_read_lock){....}-{1:3}, at: debug_show_all_locks+0x2e/0x180
4 locks held by kworker/0:1H/60:
 #0: ffff88801b3b6948 ((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: ffff888116884398 (&c->btree_trans_barrier){.+.+}-{0:0}, at: __bch2_trans_get+0x7f4/0xd80
 #3: ffff8881168a6710 (&c->gc_lock){++++}-{4:4}, at: bch2_btree_update_start+0x542/0x1de0
4 locks held by kworker/u9:3/1882:
 #0: ffff8881198f7148 ((wq_completion)btree_update#3){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc90009a07bc0 ((work_completion)(&c->btree_interior_update_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
 #2: ffff888116084398 (&c->btree_trans_barrier){.+.+}-{0:0}, at: bch2_trans_srcu_lock+0xaf/0x220
 #3: ffff8881160a6710 (&c->gc_lock){++++}-{4:4}, at: bch2_btree_update_start+0x542/0x1de0
4 locks held by kworker/u9:4/3042:
 #0: ffff88803a543948 ((wq_completion)btree_update){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc9000a5d7bc0 ((work_completion)(&c->btree_interior_update_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
 #2: ffff888116884398 (&c->btree_trans_barrier){.+.+}-{0:0}, at: bch2_trans_srcu_lock+0xaf/0x220
 #3: ffff8881168a6710 (&c->gc_lock){++++}-{4:4}, at: bch2_btree_update_start+0x542/0x1de0
2 locks held by getty/5674:
 #0: ffff888109d7b0a0 (&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
6 locks held by syz-executor/5851:
 #0: ffff88802319e0e0 (&type->s_umount_key#57){++++}-{4:4}, at: deactivate_super+0xa9/0xe0
 #1: ffff888116880278 (&c->state_lock){++++}-{4:4}, at: __bch2_fs_stop+0xf8/0x900
 #2: ffff8881168caf68 (&j->reclaim_lock){+.+.}-{4:4}, at: journal_flush_done+0x86/0x810
 #3: ffff888116884398 (&c->btree_trans_barrier){.+.+}-{0:0}, at: __bch2_trans_get+0x7f4/0xd80
 #4: ffff888116884740 (&wb->flushing.lock){+.+.}-{4:4}, at: btree_write_buffer_flush_seq+0x18bd/0x1a40
 #5: ffff8881168a6710 (&c->gc_lock){++++}-{4:4}, at: bch2_btree_update_start+0x542/0x1de0
3 locks held by kworker/1:4/6246:
 #0: ffff88801a480d48 ((wq_completion)events){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc9000265fbc0 (free_ipc_work){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
 #2: ffffffff8e13f9b8 (rcu_state.exp_mutex){+.+.}-{4:4}, at: synchronize_rcu_expedited+0x2f6/0x730
1 lock held by bch-reclaim/loo/6954:
 #0: ffff8881168caf68 (&j->reclaim_lock){+.+.}-{4:4}, at: bch2_journal_reclaim_thread+0x16b/0x4f0
2 locks held by syz-executor/6966:
 #0: ffff88801ea8c0e0 (&type->s_umount_key#57){++++}-{4:4}, at: deactivate_super+0xa9/0xe0
 #1: ffff888116080278 (&c->state_lock){++++}-{4:4}, at: __bch2_fs_stop+0xf8/0x900
2 locks held by syz-executor/7353:
 #0: ffff88803f94a0e0 (&type->s_umount_key#57){++++}-{4:4}, at: deactivate_super+0xa9/0xe0
 #1: ffff888117100278 (&c->state_lock){++++}-{4:4}, at: __bch2_fs_stop+0xf8/0x900
6 locks held by syz-executor/7743:
 #0: ffff8881196760e0 (&type->s_umount_key#57){++++}-{4:4}, at: deactivate_super+0xa9/0xe0
 #1: ffff888131580278 (&c->state_lock){++++}-{4:4}, at: __bch2_fs_stop+0xf8/0x900
 #2: ffff8881315caf68 (&j->reclaim_lock){+.+.}-{4:4}, at: journal_flush_done+0x86/0x810
 #3: ffff888131584398 (&c->btree_trans_barrier){.+.+}-{0:0}, at: __bch2_trans_get+0x7f4/0xd80
 #4: ffff888131584740 (&wb->flushing.lock){+.+.}-{4:4}, at: btree_write_buffer_flush_seq+0x18bd/0x1a40
 #5: ffff8881315a6710 (&c->gc_lock){++++}-{4:4}, at: bch2_btree_update_start+0x542/0x1de0
6 locks held by syz-executor/8500:
 #0: ffff88812a7ec0e0 (&type->s_umount_key#57){++++}-{4:4}, at: deactivate_super+0xa9/0xe0
 #1: ffff888134c80278 (&c->state_lock){++++}-{4:4}, at: __bch2_fs_stop+0xf8/0x900
 #2: ffff888134ccaf68 (&j->reclaim_lock){+.+.}-{4:4}, at: journal_flush_done+0x86/0x810
 #3: ffff888134c84398 (&c->btree_trans_barrier){.+.+}-{0:0}, at: __bch2_trans_get+0x7f4/0xd80
 #4: ffff888134c84740 (&wb->flushing.lock){+.+.}-{4:4}, at: btree_write_buffer_flush_seq+0x18bd/0x1a40
 #5: ffff888134ca6710 (&c->gc_lock){++++}-{4:4}, at: bch2_btree_update_start+0x542/0x1de0
1 lock held by syz.7.296/8528:
 #0: ffff88802319e0e0 (&type->s_umount_key#57){++++}-{4:4}, at: super_lock+0x2a9/0x3b0
1 lock held by bch-reclaim/loo/8652:
 #0: ffff8881315caf68 (&j->reclaim_lock){+.+.}-{4:4}, at: bch2_journal_reclaim_thread+0x16b/0x4f0
1 lock held by bch-reclaim/loo/8670:
 #0: ffff888134ccaf68 (&j->reclaim_lock){+.+.}-{4:4}, at: bch2_journal_reclaim_thread+0x16b/0x4f0
1 lock held by dhcpcd/8675:
 #0: ffff88803c382608 (&sb->s_type->i_mutex_key#11){+.+.}-{4:4}, at: sock_close+0x9b/0x240
1 lock held by syz.5.432/9442:
 #0: ffff88801ea8c0e0 (&type->s_umount_key#57){++++}-{4:4}, at: super_lock+0x2a9/0x3b0
1 lock held by syz.0.457/9510:
 #0: ffff88802319e0e0 (&type->s_umount_key#57){++++}-{4:4}, at: super_lock+0x2a9/0x3b0
1 lock held by syz.6.463/9527:
 #0: ffff88803f94a0e0 (&type->s_umount_key#57){++++}-{4:4}, at: super_lock+0x2a9/0x3b0
2 locks held by syz.3.467/9622:
 #0: ffff888021830428 (sb_writers#17){.+.+}-{0:0}, at: direct_splice_actor+0x49/0x160
 #1: ffff88802b99a740 (&sb->s_type->i_mutex_key#24){++++}-{4:4}, at: bch2_direct_write+0x192/0x2ce0
5 locks held by syz-executor/9634:
 #0: ffff888127710dc0 (&hdev->req_lock){+.+.}-{4:4}, at: hci_unregister_dev+0x212/0x510
 #1: ffff8881277100b8 (&hdev->lock){+.+.}-{4:4}, at: hci_dev_close_sync+0x66a/0x1330
 #2: ffffffff8f69d988 (hci_cb_list_lock){+.+.}-{4:4}, at: hci_conn_hash_flush+0xa1/0x230
 #3: ffff8880684b6338 (&conn->lock#2){+.+.}-{4:4}, at: l2cap_conn_del+0x70/0x680
 #4: ffffffff8e13f9b8 (rcu_state.exp_mutex){+.+.}-{4:4}, at: synchronize_rcu_expedited+0x3b9/0x730

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

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: 9691 Comm: rm 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:preempt_count_add+0x42/0x1a0
Code: ab 99 48 c1 e8 03 42 0f b6 04 38 84 c0 0f 85 f1 00 00 00 83 3d 2e d7 1b 18 00 75 07 65 8b 05 35 84 10 11 65 01 3d 2e 84 10 11 <48> c7 c0 20 d3 ab 99 48 c1 e8 03 42 0f b6 04 38 84 c0 0f 85 ec 00
RSP: 0018:ffffc9000409f7e0 EFLAGS: 00000082
RAX: 0000000080000000 RBX: ffff8881000009c0 RCX: ffffffff99abd303
RDX: 0000000000000000 RSI: ffffffff8be33860 RDI: 0000000000000001
RBP: ffffc9000409f880 R08: ffffffff8fa39037 R09: 1ffffffff1f47206
R10: dffffc0000000000 R11: fffffbfff1f47207 R12: dffffc0000000000
R13: 0000000000040001 R14: 0000000000000a06 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8881a3c18000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000056406358e680 CR3: 0000000063626000 CR4: 00000000000006f0
Call Trace:
 <TASK>
 _raw_spin_lock_irqsave+0x8c/0xf0
 __slab_free+0x1b7/0x3c0
 qlist_free_all+0x97/0x140
 kasan_quarantine_reduce+0x148/0x160
 __kasan_slab_alloc+0x22/0x80
 __kmalloc_noprof+0x224/0x4f0
 tomoyo_realpath_from_path+0xe3/0x5d0
 tomoyo_path_perm+0x213/0x4b0
 security_inode_getattr+0x12f/0x330
 vfs_fstatat+0xb1/0x170
 __x64_sys_newfstatat+0x116/0x190
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fdb362698a9
Code: 49 01 00 09 00 00 00 83 c8 ff c3 48 89 f2 b9 00 01 00 00 48 89 fe bf 9c ff ff ff e9 00 00 00 00 41 89 ca b8 06 01 00 00 0f 05 <45> 31 c0 3d 00 f0 ff ff 76 0c f7 d8 41 83 c8 ff 89 05 a1 49 01 00
RSP: 002b:00007ffea5d533b8 EFLAGS: 00000206 ORIG_RAX: 0000000000000106
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fdb362698a9
RDX: 00007ffea5d53460 RSI: 00007fdb362743d4 RDI: 0000000000000003
RBP: 00007ffea5d53520 R08: 00007fdb362449e0 R09: 00007fdb36244000
R10: 0000000000001000 R11: 0000000000000206 R12: 00007fdb36244000
R13: 00007ffea5d535a8 R14: 00007fdb36244000 R15: 0000000000000001
 </TASK>
