Enforce sparse-only guest directory copy#123
Merged
sjmiller609 merged 2 commits intomainfrom Mar 7, 2026
Merged
Conversation
There was a problem hiding this comment.
Risk assessment: Medium-High.
I evaluated the risk from the code diff itself (not PR narrative). This change modifies fork-critical runtime behavior in shared paths:
- switches guest directory copy to sparse-only extent logic (
SEEK_DATA/SEEK_HOLE) with new platform-dependent failure behavior - changes what guest artifacts are copied (skips
logsdirectory) - alters readiness checks and error handling in fork flow for running instances
Given the production behavioral impact, platform/filesystem dependencies, and performance-sensitive codepath, this requires human review before merge.
Actions taken:
- requested reviewers:
@rgarcia,@hiroTamada - no approval issued
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Merged
rgarcia
approved these changes
Mar 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
CopyGuestDirectoryto skip logs/runtime sockets, rely on sparse extent copying, and propagateErrSparseCopyUnsupportedTesting
Note
Medium Risk
Changes the on-disk cloning path used by instance forks and introduces a hard requirement on filesystem sparse-seek support, which could break forks on some environments. Sparse extent copying and new readiness probes may surface previously hidden edge cases in fork/restore timing.
Overview
Fork cloning now preserves sparsity and skips runtime artifacts.
CopyGuestDirectoryswitches from denseio.Copyto sparse extent copying viaSEEK_DATA/SEEK_HOLE, skips thelogs/subtree (entirely) and continues skipping runtime socket files.Forks now fail explicitly when sparse seeking isn’t available. A new
forkvm.ErrSparseCopyUnsupportedis returned on unsupported filesystems/platforms andinstances.forkInstanceFromStoppedOrStandbysurfaces a clearer “sparse-capable filesystem required” error.Improved fork/exec readiness checks and tests. Guest-agent readiness probing is refactored/reused and
ForkInstancenow waits for the agent before returning a running fork; tests are updated/added to validate sparse preservation, skip behavior, and the unsupported-sparse error path, and docs describe the new copy requirements.Written by Cursor Bugbot for commit 30c2676. This will update automatically on new commits. Configure here.