------------[ cut here ]------------ WARNING: CPU: 0 PID: 4554 at fs/btrfs/block-group.c:3688 do_chunk_alloc fs/btrfs/block-group.c:3688 [inline] WARNING: CPU: 0 PID: 4554 at fs/btrfs/block-group.c:3688 btrfs_chunk_alloc+0xe47/0xff0 fs/btrfs/block-group.c:3930 Modules linked in: CPU: 0 PID: 4554 Comm: syz.2.44 Not tainted 6.1.123-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 RIP: 0010:do_chunk_alloc fs/btrfs/block-group.c:3688 [inline] RIP: 0010:btrfs_chunk_alloc+0xe47/0xff0 fs/btrfs/block-group.c:3930 Code: fd 48 c7 c7 c0 28 51 8b 44 89 e6 e8 53 3f 99 fd 0f 0b e9 02 fe ff ff e8 87 25 d1 fd 48 c7 c7 c0 28 51 8b 89 ee e8 39 3f 99 fd <0f> 0b e9 0d fe ff ff e8 6d 25 d1 fd 48 c7 c7 c0 28 51 8b 44 89 e6 RSP: 0018:ffffc90004aeeb98 EFLAGS: 00010246 RAX: 3807ee706c9d3000 RBX: ffff8880292d8001 RCX: 0000000000080000 RDX: ffffc9000f9cf000 RSI: 00000000000130b9 RDI: 00000000000130ba RBP: ffffffffffffffe4 R08: ffffffff8152b84e R09: ffffed10171c4f1c R10: 0000000000000000 R11: dffffc0000000001 R12: ffff8880766b6800 R13: dffffc0000000000 R14: ffff888026035000 R15: 0000000000000000 FS: 00007fec18f636c0(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005582f9bb5668 CR3: 000000007802b000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: find_free_extent_update_loop fs/btrfs/extent-tree.c:4125 [inline] find_free_extent+0x49cc/0x56d0 fs/btrfs/extent-tree.c:4511 btrfs_reserve_extent+0x424/0x810 fs/btrfs/extent-tree.c:4604 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:2491 filemap_fdatawrite_wbc+0x121/0x180 mm/filemap.c:388 __filemap_fdatawrite_range mm/filemap.c:421 [inline] __filemap_fdatawrite mm/filemap.c:427 [inline] filemap_flush+0x11a/0x170 mm/filemap.c:454 btrfs_remap_file_range_prep fs/btrfs/reflink.c:850 [inline] btrfs_remap_file_range+0x447/0xe80 fs/btrfs/reflink.c:896 vfs_copy_file_range+0x10d6/0x1640 fs/read_write.c:1518 __do_sys_copy_file_range fs/read_write.c:1596 [inline] __se_sys_copy_file_range+0x3ea/0x5d0 fs/read_write.c:1559 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fec18185d29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fec18f63038 EFLAGS: 00000246 ORIG_RAX: 0000000000000146 RAX: ffffffffffffffda RBX: 00007fec18376080 RCX: 00007fec18185d29 RDX: 0000000000000006 RSI: 0000000000000000 RDI: 0000000000000007 RBP: 00007fec18201b08 R08: 0000000000000006 R09: 0000000000000000 R10: 00000000200000c0 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fec18376080 R15: 00007ffc84808ed8