Skip to content

Validate FileContext against on-disk state on resume - #59

Merged
bugadani merged 4 commits into
masterfrom
validate-context-resume-on-disk
Oct 23, 2026
Merged

bugadani merged 4 commits into
masterfrom
validate-context-resume-on-disk

Conversation

@MabezDev

@MabezDev MabezDev commented May 1, 2026 •

Copy link
Copy Markdown
Owner

File::new_from_context is now public. It reads the directory entry from the disk and compares it with the entry in the FileContext. This finds a modified, deleted or reformatted file without a directory scan.

DirEntry::{to_file_with_context, try_to_file_with_context} do not change.

@MabezDev
MabezDev force-pushed the validate-context-resume-on-disk branch from 318e0f4 to 8b23116 Compare May 1, 2026 14:56
MabezDev and others added 3 commits October 23, 2026 20:23
new_from_context now re-reads the 32-byte directory entry from disk and
compares it against the snapshot in the FileContext, catching
modifications, deletions, or reformats without requiring a directory
traversal. This is the key performance property — resuming a file deep
in a cluster chain costs one seek + one sector read instead of O(n)
chain walk or directory scan.

Breaking: new_from_context is now async and returns Result.
The DirEntry::to_file_with_context and try_to_file_with_context methods
are also now async, delegating to new_from_context.
…try for on-disk check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bugadani
bugadani force-pushed the validate-context-resume-on-disk branch from 2c085ba to 4393b19 Compare October 23, 2026 18:33
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bugadani
bugadani merged commit 7961cd4 into master Oct 23, 2026
4 checks passed
@bugadani
bugadani deleted the validate-context-resume-on-disk branch October 23, 2026 18:53
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