assertion failed: space_info->reclaim_size >= ticket->bytes, in fs/btrfs/space-info.c:436
------------[ cut here ]------------
kernel BUG at fs/btrfs/space-info.c:436!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 59 Comm: kworker/u4:4 Not tainted 6.6.0-syzkaller-15365-g305230142ae0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
Workqueue: btrfs-endio-write btrfs_work_helper
RIP: 0010:remove_ticket fs/btrfs/space-info.c:436 [inline]
RIP: 0010:btrfs_try_granting_tickets+0x59f/0x5d0 fs/btrfs/space-info.c:468
Code: fe e9 ca fa ff ff e8 00 76 d6 fd 48 c7 c7 20 29 ad 8b 48 c7 c6 e0 2f ad 8b 48 c7 c2 a0 29 ad 8b b9 b4 01 00 00 e8 31 b5 5c 07 <0f> 0b e8 da 75 d6 fd 48 c7 c7 20 29 ad 8b 48 c7 c6 80 29 ad 8b 48
RSP: 0018:ffffc900015a7780 EFLAGS: 00010246
RAX: 0000000000000059 RBX: ffffffffffffb000 RCX: 290148009ffb0d00
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000000000028000 R08: ffffffff8171771c R09: 1ffff920002b4e90
R10: dffffc0000000000 R11: fffff520002b4e91 R12: ffff8880357e68f0
R13: ffffc9001582f160 R14: dffffc0000000000 R15: 1ffff11006afcd1e
FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f5788578038 CR3: 000000002ef27000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
btrfs_space_info_free_bytes_may_use fs/btrfs/space-info.h:232 [inline]
block_rsv_release_bytes fs/btrfs/block-rsv.c:154 [inline]
btrfs_block_rsv_release+0x506/0x5f0 fs/btrfs/block-rsv.c:295
btrfs_inode_rsv_release fs/btrfs/delalloc-space.c:230 [inline]
btrfs_delalloc_release_metadata+0x19b/0x2c0 fs/btrfs/delalloc-space.c:403
btrfs_remove_ordered_extent+0x19c/0xa20 fs/btrfs/ordered-data.c:602
btrfs_finish_one_ordered+0xbfc/0x1670 fs/btrfs/inode.c:3221
btrfs_work_helper+0x37c/0xbd0 fs/btrfs/async-thread.c:315
process_one_work kernel/workqueue.c:2630 [inline]
process_scheduled_works+0x90f/0x1400 kernel/workqueue.c:2703
worker_thread+0xa5f/0xff0 kernel/workqueue.c:2784
kthread+0x2d3/0x370 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:remove_ticket fs/btrfs/space-info.c:436 [inline]
RIP: 0010:btrfs_try_granting_tickets+0x59f/0x5d0 fs/btrfs/space-info.c:468
Code: fe e9 ca fa ff ff e8 00 76 d6 fd 48 c7 c7 20 29 ad 8b 48 c7 c6 e0 2f ad 8b 48 c7 c2 a0 29 ad 8b b9 b4 01 00 00 e8 31 b5 5c 07 <0f> 0b e8 da 75 d6 fd 48 c7 c7 20 29 ad 8b 48 c7 c6 80 29 ad 8b 48
RSP: 0018:ffffc900015a7780 EFLAGS: 00010246
RAX: 0000000000000059 RBX: ffffffffffffb000 RCX: 290148009ffb0d00
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000000000028000 R08: ffffffff8171771c R09: 1ffff920002b4e90
R10: dffffc0000000000 R11: fffff520002b4e91 R12: ffff8880357e68f0
R13: ffffc9001582f160 R14: dffffc0000000000 R15: 1ffff11006afcd1e
FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f5788578038 CR3: 000000002ef27000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400