INFO: task kworker/0:0:9 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:0     state:D stack:14096 pid:9     tgid:9     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/u9:0:26 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:0    state:D stack:17952 pid:26    tgid:26    ppid:2      task_flags:0x4208060 flags:0x00004000
Workqueue: writeback wb_workfn (flush-bcachefs-1)
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_write_inode+0x64a/0xad0
 bch2_vfs_write_inode+0x84/0xd0
 __writeback_single_inode+0x6f1/0xff0
 writeback_sb_inodes+0x6c7/0x1010
 __writeback_inodes_wb+0x111/0x240
 wb_writeback+0x44f/0xaf0
 wb_workfn+0xaef/0xef0
 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/u9:4:2961 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:4    state:D stack:20904 pid:2961  tgid:2961  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 syz.1.4:5956 blocked for more than 143 seconds.
      Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.1.4         state:D stack:10328 pid:5956  tgid:5918  ppid:5846   task_flags:0x400140 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_extent_update+0x33e/0x900
 bch2_fpunch_at+0x6a3/0xbf0
 __bch2_resume_logged_op_truncate+0x50e/0x700
 bch2_truncate+0x155/0x200
 bchfs_truncate+0x8b1/0xc20
 notify_change+0xb36/0xe40
 do_truncate+0x1a4/0x220
 path_openat+0x306c/0x3830
 do_filp_open+0x1fa/0x410
 do_sys_openat2+0x121/0x1c0
 __x64_sys_open+0x11e/0x150
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fb5ed38ebe9
RSP: 002b:00007fb5ee1a3038 EFLAGS: 00000246 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 00007fb5ed5c6090 RCX: 00007fb5ed38ebe9
RDX: 0000000000000020 RSI: 000000000014927e RDI: 00002000000001c0
RBP: 00007fb5ed411e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fb5ed5c6128 R14: 00007fb5ed5c6090 R15: 00007ffc05b7f578
 </TASK>

Showing all locks held in the system:
1 lock held by pool_workqueue_/3:
 #0: ffffffff8e13f9b8 (rcu_state.exp_mutex){+.+.}-{4:4}, at: synchronize_rcu_expedited+0x2f6/0x730
2 locks held by kworker/0:0/9:
 #0: ffff888027674548 ((wq_completion)bcachefs_write_ref){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc900000c7bc0 ((work_completion)(&ca->discard_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
2 locks held by kworker/u8:1/13:
4 locks held by kworker/u9:0/26:
 #0: ffff888102a95148 ((wq_completion)writeback){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc900001efbc0 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
 #2: ffff88803a5a00e0 (&type->s_umount_key#57){++++}-{4:4}, at: super_trylock_shared+0x20/0xf0
 #3: ffff888103718cc8 (&inode->ei_update_lock){+.+.}-{4:4}, at: bch2_vfs_write_inode+0x6a/0xd0
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:4/2961:
 #0: ffff88803bb5f148 ((wq_completion)btree_update){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc90008dcfbc0 ((work_completion)(&c->btree_interior_update_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
1 lock held by dhcpcd/5593:
 #0: ffffffff8f539b08 (rtnl_mutex){+.+.}-{4:4}, at: devinet_ioctl+0x323/0x1b50
2 locks held by getty/5676:
 #0: ffff88810e5850a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70
 #1: ffffc9000291b2f0 (&ldata->atomic_read_lock){+.+.}-{4:4}, at: n_tty_read+0x43e/0x1400
4 locks held by kworker/u8:4/5888:
 #0: ffff88801b2f7148 ((wq_completion)netns){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc90003bdfbc0 (net_cleanup_work){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
 #2: ffffffff8f52cc50 (pernet_ops_rwsem){++++}-{4:4}, at: cleanup_net+0xf7/0x800
 #3: ffffffff8f539b08 (rtnl_mutex){+.+.}-{4:4}, at: ipmr_net_exit_batch+0x20/0x90
3 locks held by syz.1.4/5956:
 #0: ffff88803a5a0428 (sb_writers#15){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90
 #1: ffff8881037188e0 (&sb->s_type->i_mutex_key#22){++++}-{4:4}, at: do_truncate+0x171/0x220
 #2: ffff88803ba80a50 (&c->snapshot_create_lock){.+.+}-{4:4}, at: bch2_truncate+0xeb/0x200
3 locks held by kworker/u9:8/8478:
 #0: ffff88801a489148 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc90002a17bc0 ((linkwatch_work).work){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
 #2: ffffffff8f539b08 (rtnl_mutex){+.+.}-{4:4}, at: linkwatch_event+0xe/0x60
3 locks held by syz-executor/9330:
2 locks held by syz.2.598/9390:

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

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+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: 5297 Comm: udevd 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:lockdep_hardirqs_on_prepare+0x191/0x2a0
Code: ff 31 73 2c 41 8b 46 20 a9 00 00 04 00 74 dc 25 00 00 03 00 83 f8 01 ba 07 00 00 00 83 da 00 48 89 df 4c 89 f6 e8 bf 45 00 00 <85> c0 75 bd eb 11 48 c7 c7 10 ad 00 8e 4c 89 fe e8 7a 4d 62 03 eb
RSP: 0018:ffffc90004767680 EFLAGS: 00000002
RAX: 0000000000000001 RBX: ffff888108e51cc0 RCX: ffffffff934aa2f8
RDX: 0000000000000007 RSI: ffff888108e527d8 RDI: ffff888108e51cc0
RBP: ffffc90004767748 R08: ffffffff8fa3a037 R09: 1ffffffff1f47406
R10: dffffc0000000000 R11: fffffbfff1f47407 R12: ffff888108e52800
R13: ffff888133438000 R14: ffff888108e527d8 R15: 0000000000000001
FS:  00007f5080d69c80(0000) GS:ffff8880b8615000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055555eefa608 CR3: 000000001ff60000 CR4: 00000000000006f0
Call Trace:
 <TASK>
 trace_hardirqs_on+0x28/0x40
 _raw_spin_unlock_irqrestore+0x85/0x110
 debug_check_no_obj_freed+0x451/0x470
 __free_frozen_pages+0x4dd/0xd30
 __slab_free+0x303/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:0x7f50809165f4
Code: 64 c7 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 10 48 8b 15 03 a8 0d 00 f7 d8 41 83 c8
RSP: 002b:00007ffc7d30a4c8 EFLAGS: 00000206 ORIG_RAX: 0000000000000106
RAX: ffffffffffffffda RBX: 0000564dd8a11910 RCX: 00007f50809165f4
RDX: 00007ffc7d30a4e0 RSI: 00007f50809b3130 RDI: 000000000000000f
RBP: 0000564dd8c97ac0 R08: 0000000000090800 R09: 0000564dd89f3d40
R10: 0000000000001000 R11: 0000000000000206 R12: 00007ffc7d30a4e0
R13: 00000000000000fd R14: 0000564daa4991c4 R15: 0000000000000000
 </TASK>
