INFO: task kworker/u9:2:53 blocked for more than 143 seconds.
      Tainted: G             L      syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u9:2    state:D stack:23264 pid:53    tgid:53    ppid:2      task_flags:0x4208060 flags:0x00080000
Workqueue: writeback wb_workfn (flush-btrfs-103)
Call Trace:
 <TASK>
 __schedule+0x15dd/0x52d0
 schedule+0x164/0x360
 btrfs_lock_extent_bits+0x593/0x700
 btrfs_invalidate_folio+0x43d/0xc40
 btrfs_writepages+0x12ff/0x2440
 do_writepages+0x32e/0x550
 __writeback_single_inode+0x133/0x11a0
 writeback_sb_inodes+0x992/0x1a20
 wb_writeback+0x456/0xb70
 wb_workfn+0x414/0xf50
 process_scheduled_works+0xb6e/0x18c0
 worker_thread+0xa53/0xfc0
 kthread+0x388/0x470
 ret_from_fork+0x51e/0xb90
 ret_from_fork_asm+0x1a/0x30
 </TASK>
INFO: task syz.7.2684:18422 blocked for more than 143 seconds.
      Tainted: G             L      syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.7.2684      state:D stack:22336 pid:18422 tgid:18421 ppid:14939  task_flags:0x400140 flags:0x00080002
Call Trace:
 <TASK>
 __schedule+0x15dd/0x52d0
 schedule+0x164/0x360
 wb_wait_for_completion+0x3e8/0x790
 __writeback_inodes_sb_nr+0x24b/0x2c0
 try_to_writeback_inodes_sb+0x9a/0xc0
 btrfs_commit_transaction+0x82e/0x31a0
 btrfs_sync_file+0xdee/0x1260
 btrfs_do_write_iter+0x72e/0x880
 iter_file_splice_write+0x9a1/0x10f0
 direct_splice_actor+0x101/0x160
 splice_direct_to_actor+0x53a/0xc70
 do_splice_direct+0x195/0x290
 do_sendfile+0x535/0x7d0
 __se_sys_sendfile64+0x144/0x1a0
 do_syscall_64+0x14d/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fb655d9c799
RSP: 002b:00007fb656d18028 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007fb656015fa0 RCX: 00007fb655d9c799
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000004
RBP: 00007fb655e32c99 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000020fffe82 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fb656016038 R14: 00007fb656015fa0 R15: 00007ffe2de9bb68
 </TASK>
INFO: task syz.7.2684:18457 blocked for more than 143 seconds.
      Tainted: G             L      syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.7.2684      state:D stack:24864 pid:18457 tgid:18421 ppid:14939  task_flags:0x400040 flags:0x00080002
Call Trace:
 <TASK>
 __schedule+0x15dd/0x52d0
 schedule+0x164/0x360
 wait_current_trans+0x39f/0x590
 start_transaction+0x6a7/0x1650
 btrfs_clone+0x128a/0x24d0
 btrfs_clone_files+0x26b/0x3e0
 btrfs_remap_file_range+0x762/0x1320
 vfs_clone_file_range+0x42c/0x7b0
 do_vfs_ioctl+0xe0f/0x1530
 __se_sys_ioctl+0x82/0x170
 do_syscall_64+0x14d/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fb655d9c799
RSP: 002b:00007fb656cf7028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fb656016090 RCX: 00007fb655d9c799
RDX: 00002000000000c0 RSI: 000000004020940d RDI: 0000000000000007
RBP: 00007fb655e32c99 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fb656016128 R14: 00007fb656016090 R15: 00007ffe2de9bb68
 </TASK>

Showing all locks held in the system:
1 lock held by khungtaskd/35:
 #0: ffffffff8e75e520 (rcu_read_lock){....}-{1:3}, at: debug_show_all_locks+0x2e/0x180
2 locks held by kworker/u9:2/53:
 #0: ffff8881622be948 ((wq_completion)writeback){+.+.}-{0:0}, at: process_scheduled_works+0xa52/0x18c0
 #1: ffffc90000bd7c40 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_scheduled_works+0xa8d/0x18c0
2 locks held by syslogd/5237:
 #0: ffff88823c63ade0 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x31/0x150
 #1: ffff88823c624588 (psi_seq){-.-.}-{0:0}, at: psi_task_switch+0x53/0x880
2 locks held by getty/5635:
 #0: ffff888175d2f0a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70
 #1: ffffc9000356b2f0 (&ldata->atomic_read_lock){+.+.}-{4:4}, at: n_tty_read+0x45c/0x13c0
4 locks held by udevd/8398:
 #0: ffff8881816399e0 (&p->lock){+.+.}-{4:4}, at: seq_read_iter+0xb7/0xe10
 #1: ffff8881b90c8c88 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_seq_start+0x5c/0x420
 #2: ffff8881745bee18 (kn->active#29){++++}-{0:0}, at: kernfs_seq_start+0xb2/0x420
 #3: ffff8881a694c198 (&dev->mutex){....}-{4:4}, at: manufacturer_show+0x26/0xa0
5 locks held by kworker/1:9/11821:
 #0: ffff888105684548 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: process_scheduled_works+0xa52/0x18c0
 #1: ffffc900036a7c40 ((work_completion)(&hub->events)){+.+.}-{0:0}, at: process_scheduled_works+0xa8d/0x18c0
 #2: ffff88810bd93198 (&dev->mutex){....}-{4:4}, at: hub_event+0x17f/0x4f30
 #3: ffff8881a694c198 (&dev->mutex){....}-{4:4}, at: __device_attach+0x88/0x450
 #4: ffff8881a694a160 (&dev->mutex){....}-{4:4}, at: __device_attach+0x88/0x450
5 locks held by syz.7.2684/18422:
 #0: ffff88811187c420 (sb_writers#13){.+.+}-{0:0}, at: direct_splice_actor+0x49/0x160
 #1: ffff88811187c610 (sb_internal#2){.+.+}-{0:0}, at: btrfs_sync_file+0xca8/0x1260
 #2: ffff8881047f26f8 (btrfs_trans_num_writers){++++}-{0:0}, at: join_transaction+0x41b/0xd60
 #3: ffff8881047f2720 (btrfs_trans_num_extwriters){++++}-{0:0}, at: join_transaction+0x41b/0xd60
 #4: ffff88811187c0e0 (&type->s_umount_key#56){++++}-{4:4}, at: try_to_writeback_inodes_sb+0x22/0xc0
4 locks held by syz.7.2684/18457:
 #0: ffff88811187c420 (sb_writers#13){.+.+}-{0:0}, at: do_vfs_ioctl+0xe0f/0x1530
 #1: ffff88811921e370 (&sb->s_type->i_mutex_key#27){++++}-{4:4}, at: btrfs_inode_lock+0x51/0xe0
 #2: ffff88811921e200 (&ei->i_mmap_lock){++++}-{4:4}, at: btrfs_inode_lock+0xcb/0xe0
 #3: ffff88811187c610 (sb_internal#2){.+.+}-{0:0}, at: btrfs_clone+0x128a/0x24d0
1 lock held by btrfs-transacti/18456:
 #0: ffff8881047f08c8 (&fs_info->transaction_kthread_mutex){+.+.}-{4:4}, at: transaction_kthread+0xe4/0x450
2 locks held by syz.0.3319/21745:

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

NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 35 Comm: khungtaskd Tainted: G             L      syzkaller #0 PREEMPT(full) 
Tainted: [L]=SOFTLOCKUP
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+0xe8/0x150
 nmi_cpu_backtrace+0x274/0x2d0
 nmi_trigger_cpumask_backtrace+0x17a/0x300
 sys_info+0x135/0x170
 watchdog+0xfd9/0x1030
 kthread+0x388/0x470
 ret_from_fork+0x51e/0xb90
 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: 21745 Comm: syz.0.3319 Tainted: G             L      syzkaller #0 PREEMPT(full) 
Tainted: [L]=SOFTLOCKUP
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
RIP: 0010:__sanitizer_cov_trace_const_cmp4+0x82/0x90
Code: 8d 52 28 4d 39 ca 77 22 89 ff 89 f6 49 ff c0 4c 89 01 48 c7 44 11 08 05 00 00 00 48 89 7c 11 10 48 89 74 11 18 48 89 44 11 20 <c3> cc cc cc cc cc 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90
RSP: 0018:ffffc9000668f698 EFLAGS: 00000097
RAX: ffffffff81be2bc3 RBX: 1ffff92000cd1ed8 RCX: 0000000000000002
RDX: ffff888113f30000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc9000668f770 R08: ffffea0006c22447 R09: 1ffffd4000d84488
R10: dffffc0000000000 R11: fffff94000d84489 R12: 0000000000000000
R13: ffff8881121de000 R14: dffffc0000000000 R15: ffff888102a90d80
FS:  00007fc4b59096c0(0000) GS:ffff8882a9460000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b33806000 CR3: 000000019519a000 CR4: 00000000000006f0
Call Trace:
 <TASK>
 css_rstat_updated+0x143/0x530
 memcg_rstat_updated+0x2c/0x220
 count_memcg_events+0xc5/0x290
 memcg1_commit_charge+0xcc/0x290
 __mem_cgroup_charge+0x11f/0x1e0
 shmem_alloc_and_add_folio+0x7d0/0xf80
 shmem_get_folio_gfp+0x5a9/0x1670
 shmem_write_begin+0x16c/0x330
 generic_perform_write+0x2e2/0x8f0
 shmem_file_write_iter+0xf8/0x120
 vfs_write+0x61d/0xb90
 ksys_write+0x150/0x270
 do_syscall_64+0x14d/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc4b495cfce
Code: 08 0f 85 a5 a8 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 80 00 00 00 00 48 83 ec 08
RSP: 002b:00007fc4b5908da8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fc4b59096c0 RCX: 00007fc4b495cfce
RDX: 0000000004000000 RSI: 00007fc4aa600000 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
R13: 00007fc4b5908ee0 R14: 00007fc4b5908ea0 R15: 00007fc4aa600000
 </TASK>
