loop0: detected capacity change from 0 to 32768 BTRFS: device fsid ed167579-eb65-4e76-9a50-61ac97e9b59d devid 1 transid 8 /dev/loop0 (7:0) scanned by syz.0.0 (5361) BTRFS info (device loop0): first mount of filesystem ed167579-eb65-4e76-9a50-61ac97e9b59d BTRFS info (device loop0): using sha256 (sha256-lib) checksum algorithm BTRFS info (device loop0): rebuilding free space tree BTRFS info (device loop0): disabling free space tree BTRFS info (device loop0): clearing compat-ro feature flag for FREE_SPACE_TREE (0x1) BTRFS info (device loop0): clearing compat-ro feature flag for FREE_SPACE_TREE_VALID (0x2) BTRFS info (device loop0): balance: start -d -m BTRFS info (device loop0): relocating block group 6881280 flags data|metadata BTRFS info (device loop0): relocating block group 5242880 flags data|metadata ------------[ cut here ]------------ WARNING: CPU: 0 PID: 5361 at fs/btrfs/extent-tree.c:3230 __btrfs_free_extent+0x28a4/0x4250 fs/btrfs/extent-tree.c:3230 Modules linked in: CPU: 0 UID: 0 PID: 5361 Comm: syz.0.0 Not tainted 6.17.0-rc1-syzkaller-00016-g8742b2d8935f #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 RIP: 0010:__btrfs_free_extent+0x28a4/0x4250 fs/btrfs/extent-tree.c:3230 Code: 0b 01 0f 85 a6 01 00 00 e8 99 0f fc fd e9 c0 01 00 00 80 3d 7c bc c9 0b 01 0f 85 29 02 00 00 e8 82 0f fc fd e9 43 02 00 00 90 <0f> 0b 90 48 8b 44 24 20 48 b9 00 00 00 00 00 fc ff df 80 3c 08 00 RSP: 0018:ffffc9000d38eca0 EFLAGS: 00010246 RAX: 0000000000000002 RBX: ffff888051dcfe00 RCX: 0000000000000005 RDX: ffffffff83c38829 RSI: ffffffff8e6cabc0 RDI: 00000000fffffffe RBP: ffffc9000d38ee50 R08: ffff88801f6c8000 R09: 0000000000000002 R10: 00000000fffffffe R11: 0000000000000000 R12: 00000000fffffffe R13: 0000000000000345 R14: ffff888051de64d0 R15: 00000000fffffffe FS: 00007f0b5d36b6c0(0000) GS:ffff88808d211000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000000042f8a000 CR4: 0000000000352ef0 Call Trace: run_delayed_tree_ref fs/btrfs/extent-tree.c:1749 [inline] run_one_delayed_ref fs/btrfs/extent-tree.c:1775 [inline] btrfs_run_delayed_refs_for_head fs/btrfs/extent-tree.c:1972 [inline] __btrfs_run_delayed_refs+0xe7f/0x4130 fs/btrfs/extent-tree.c:2047 btrfs_run_delayed_refs+0xe6/0x3b0 fs/btrfs/extent-tree.c:2159 btrfs_start_dirty_block_groups+0xd3d/0x10a0 fs/btrfs/block-group.c:3527 btrfs_commit_transaction+0x674/0x3950 fs/btrfs/transaction.c:2244 prepare_to_merge+0x929/0x1a10 fs/btrfs/relocation.c:1805 relocate_block_group+0xb06/0xd90 fs/btrfs/relocation.c:3660 btrfs_relocate_block_group+0x6bc/0xc60 fs/btrfs/relocation.c:3997 btrfs_relocate_chunk+0x12f/0x5c0 fs/btrfs/volumes.c:3446 __btrfs_balance+0x1860/0x23f0 fs/btrfs/volumes.c:4222 btrfs_balance+0xac2/0x11b0 fs/btrfs/volumes.c:4599 btrfs_ioctl_balance+0x3d3/0x610 fs/btrfs/ioctl.c:3577 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f0b5c58ebe9 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:00007f0b5d36b038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f0b5c7b5fa0 RCX: 00007f0b5c58ebe9 RDX: 0000200000000180 RSI: 00000000c4009420 RDI: 0000000000000005 RBP: 00007f0b5c611e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f0b5c7b6038 R14: 00007f0b5c7b5fa0 R15: 00007ffeedaeb048