Skip to content

fix: allow sparse holes in btree validation invariants#96

Merged
dkorbelainen merged 1 commit into
developfrom
test/verify-allocator-defrag
May 21, 2026
Merged

fix: allow sparse holes in btree validation invariants#96
dkorbelainen merged 1 commit into
developfrom
test/verify-allocator-defrag

Conversation

@dkorbelainen

@dkorbelainen dkorbelainen commented May 21, 2026

Copy link
Copy Markdown
Collaborator

validate_tree and compio_erase asserted a dense-file model (blocks
starting at 0, contiguous, covering the whole file). Writing past EOF
legitimately creates sparse holes that compio_read zero-fills on demand
and compio_erase collapses, so these debug-only asserts aborted Debug
builds on valid file states.

Relax the invariants: forbid only block overlap, allow leading/trailing
and interior holes; drop the dense-coverage asserts in compio_erase
since its range may be empty or partial inside a hole.

validate_tree and compio_erase asserted a dense-file model (blocks
starting at 0, contiguous, covering the whole file). Writing past EOF
legitimately creates sparse holes that compio_read zero-fills on demand
and compio_erase collapses, so these debug-only asserts aborted Debug
builds on valid file states.

Relax the invariants: forbid only block overlap, allow leading/trailing
and interior holes; drop the dense-coverage asserts in compio_erase
since its range may be empty or partial inside a hole.
@dkorbelainen dkorbelainen merged commit 14b950c into develop May 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant