Skip to content

Persist newly allocated extent mapping - #98

Merged
jserv merged 1 commit into
sysprog21:masterfrom
RoyWFHuang:bug/extent_persist
Aug 10, 2026
Merged

Persist newly allocated extent mapping#98
jserv merged 1 commit into
sysprog21:masterfrom
RoyWFHuang:bug/extent_persist

Conversation

@RoyWFHuang

@RoyWFHuang RoyWFHuang commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

When simplefs_file_get_block() allocates a new extent it writes ee_start, ee_len and ee_block into the ei_block buffer, then falls through to brelse() without ever marking that buffer dirty.

A clean buffer can be reclaimed at any point. If that happens before some later operation dirties the same ei_block, the extent record never reaches disk.


Summary by cubic

Mark the extent index buffer dirty when allocating a new extent so the mapping is written to disk. This prevents losing the extent record if a clean buffer is reclaimed and avoids leaking data blocks.

Written for commit cc82756. Summary will update on new commits.

Review in cubic

simplefs_file_get_block() fills in a new extent but leaves the ei_block
buffer clean, so the mapping reaches disk only if some later operation
happens to dirty the same buffer. If the buffer is reclaimed first, the
extent is lost and its data blocks leak.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

@jserv
jserv merged commit 2001736 into sysprog21:master Aug 10, 2026
4 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.

2 participants