------------[ cut here ]------------ WARNING: CPU: 0 PID: 3201 at fs/btrfs/extent-tree.c:3049 __btrfs_free_extent+0x14e5/0x1b20 Modules linked in: CPU: 0 PID: 3201 Comm: kworker/u4:8 Not tainted 6.4.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2023 Workqueue: btrfs-qgroup-rescan btrfs_work_helper RIP: 0010:__btrfs_free_extent+0x14e5/0x1b20 fs/btrfs/extent-tree.c:3049 Code: e8 70 ce c8 01 e9 67 f6 ff ff e8 d6 67 73 ff 48 c7 c7 29 c8 31 84 48 c7 c6 b3 c3 31 84 ba 71 0b 00 00 e8 ee d1 c8 01 49 89 ed <0f> 0b 48 8b 44 24 08 48 8b 00 31 db f0 48 0f ba a8 e8 19 00 00 03 RSP: 0018:ffffc90002cfb990 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 00000000fffffffe RCX: 4f05b90960678e00 RDX: 0000000000000002 RSI: ffffffff848c7b10 RDI: 00000000fffffffe RBP: ffff888174c90690 R08: 0000000000000005 R09: ffffffff81cbfd94 R10: 0000000000000002 R11: ffff8881096d1b80 R12: 0000000000000008 R13: ffff888174c90690 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff888237c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f41cee00000 CR3: 0000000175ad6000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: btrfs_run_delayed_refs_for_head fs/btrfs/extent-tree.c:1949 [inline] __btrfs_run_delayed_refs+0x805/0x1e20 fs/btrfs/extent-tree.c:2010 btrfs_run_delayed_refs+0xa0/0x300 fs/btrfs/extent-tree.c:2122 commit_cowonly_roots+0x28e/0x390 fs/btrfs/transaction.c:1308 btrfs_commit_transaction+0xb6c/0x17c0 fs/btrfs/transaction.c:2401 btrfs_qgroup_rescan_worker+0xa5b/0xad0 fs/btrfs/qgroup.c:3403 btrfs_work_helper+0x1e3/0xa70 fs/btrfs/async-thread.c:280 process_one_work+0x37b/0x7f0 kernel/workqueue.c:2405 worker_thread+0x35b/0x620 kernel/workqueue.c:2552 kthread+0x13b/0x170 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308