------------[ cut here ]------------ WARNING: CPU: 1 PID: 6565 at fs/btrfs/block-group.c:3674 do_chunk_alloc fs/btrfs/block-group.c:3674 [inline] WARNING: CPU: 1 PID: 6565 at fs/btrfs/block-group.c:3674 btrfs_chunk_alloc+0xe47/0xff0 fs/btrfs/block-group.c:3916 Modules linked in: CPU: 1 PID: 6565 Comm: kworker/u4:13 Not tainted 6.1.97-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Workqueue: events_unbound btrfs_async_reclaim_metadata_space RIP: 0010:do_chunk_alloc fs/btrfs/block-group.c:3674 [inline] RIP: 0010:btrfs_chunk_alloc+0xe47/0xff0 fs/btrfs/block-group.c:3916 Code: fd 48 c7 c7 80 08 30 8b 44 89 e6 e8 33 c9 a4 fd 0f 0b e9 02 fe ff ff e8 57 cc dc fd 48 c7 c7 80 08 30 8b 89 ee e8 19 c9 a4 fd <0f> 0b e9 0d fe ff ff e8 3d cc dc fd 48 c7 c7 80 08 30 8b 44 89 e6 RSP: 0018:ffffc90004bee8b8 EFLAGS: 00010246 RAX: 47575cda994c4700 RBX: ffff88807d2f8001 RCX: ffff888026705940 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000 RBP: ffffffffffffffe4 R08: ffffffff8152936e R09: fffff5200097dc79 R10: 0000000000000000 R11: dffffc0000000001 R12: ffff88807a507000 R13: dffffc0000000000 R14: ffff8880238c5000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005555571c2588 CR3: 0000000077a88000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: find_free_extent_update_loop fs/btrfs/extent-tree.c:4124 [inline] find_free_extent+0x49cc/0x56d0 fs/btrfs/extent-tree.c:4510 btrfs_reserve_extent+0x424/0x810 fs/btrfs/extent-tree.c:4603 cow_file_range+0x562/0xfb0 fs/btrfs/inode.c:1276 btrfs_run_delalloc_range+0x304/0x1110 fs/btrfs/inode.c:2229 writepage_delalloc+0x25d/0x580 fs/btrfs/extent_io.c:1972 __extent_writepage+0x6e3/0x1730 fs/btrfs/extent_io.c:2276 extent_write_cache_pages fs/btrfs/extent_io.c:3191 [inline] extent_writepages+0xbe0/0x17a0 fs/btrfs/extent_io.c:3313 do_writepages+0x3a2/0x670 mm/page-writeback.c:2469 filemap_fdatawrite_wbc+0x121/0x180 mm/filemap.c:388 start_delalloc_inodes+0x7df/0xca0 fs/btrfs/inode.c:9756 btrfs_start_delalloc_roots+0x741/0xab0 fs/btrfs/inode.c:9835 shrink_delalloc fs/btrfs/space-info.c:622 [inline] flush_space+0x5ee/0xe60 fs/btrfs/space-info.c:730 btrfs_async_reclaim_metadata_space+0x29b/0x340 fs/btrfs/space-info.c:1080 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308