------------[ cut here ]------------ WARNING: CPU: 1 PID: 3615 at fs/btrfs/block-group.c:3494 do_chunk_alloc fs/btrfs/block-group.c:3494 [inline] WARNING: CPU: 1 PID: 3615 at fs/btrfs/block-group.c:3494 btrfs_chunk_alloc+0xc0e/0x1020 fs/btrfs/block-group.c:3717 Modules linked in: CPU: 1 PID: 3615 Comm: kworker/u4:6 Not tainted 5.15.162-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:3494 [inline] RIP: 0010:btrfs_chunk_alloc+0xc0e/0x1020 fs/btrfs/block-group.c:3717 Code: 00 00 00 fc ff df 4c 8b 24 24 0f 1f 44 00 00 e8 88 91 fc fd eb 16 e8 81 91 fc fd 48 c7 c7 80 19 cc 8a 44 89 ee e8 a2 39 c8 fd <0f> 0b 48 8b 7c 24 20 48 c7 c6 80 27 cc 8a ba a6 0d 00 00 e9 8e 00 RSP: 0018:ffffc9000304e958 EFLAGS: 00010246 RAX: cc3ff8fee7efe500 RBX: dffffc0000000000 RCX: ffff88807d5d3b80 RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000 RBP: ffff88807d318001 R08: ffffffff816683dc R09: ffffed1017364f24 R10: 0000000000000000 R11: dffffc0000000001 R12: ffff8880768be084 R13: ffffffffffffffe4 R14: ffff888073b0d72b R15: 1ffff1100ed17c10 FS: 0000000000000000(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2ce0eff8 CR3: 000000001ab74000 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:4039 [inline] find_free_extent+0x3eb7/0x4ff0 fs/btrfs/extent-tree.c:4402 btrfs_reserve_extent+0x20a/0x540 fs/btrfs/extent-tree.c:4483 cow_file_range+0x674/0xe10 fs/btrfs/inode.c:1181 btrfs_run_delalloc_range+0x38b/0x1500 fs/btrfs/inode.c:2018 writepage_delalloc+0x283/0x5a0 fs/btrfs/extent_io.c:3802 __extent_writepage+0x57d/0xbc0 fs/btrfs/extent_io.c:4108 extent_write_cache_pages fs/btrfs/extent_io.c:5030 [inline] extent_writepages+0xbbd/0x1590 fs/btrfs/extent_io.c:5157 do_writepages+0x481/0x730 mm/page-writeback.c:2364 filemap_fdatawrite_wbc+0x1d6/0x230 mm/filemap.c:400 start_delalloc_inodes+0x7df/0xca0 fs/btrfs/inode.c:10119 btrfs_start_delalloc_roots+0x72f/0xa70 fs/btrfs/inode.c:10198 shrink_delalloc fs/btrfs/space-info.c:538 [inline] flush_space+0x650/0xd50 fs/btrfs/space-info.c:646 btrfs_async_reclaim_metadata_space+0x29b/0x340 fs/btrfs/space-info.c:953 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300