Repository navigation
MicroVM restores keep sparse files sparse - #3882
Open
Mesut Oezdil (moezdil) wants to merge 2 commits into
Open
Mesut Oezdil (moezdil) wants to merge 2 commits into
Mesut Oezdil (moezdil) wants to merge 2 commits into
Conversation
Extract wrote every regular file densely, so a microVM restore allocated the holes of sparse files in durable dirs and rootfs uppers. Create now records the holes SEEK_HOLE reports in an ATE.holes PAX record, for files with fewer blocks allocated than their size. Extract leaves the zero chunks in those holes unwritten. Zeros the workload wrote, and fully fallocated files, stay allocated. Archives without the record, and releases that don't know it, restore files densely as before. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
Mesut Oezdil (moezdil)
force-pushed
the
tarutil-keep-sparse
branch
from
November 22, 2026 12:37
3f72ed3 to
2920bb4
Compare
Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
This branch has not been deployed
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.
microVM restore wrote sparse files in durable dirs and rootfs uppers fully allocated.
this follows the review of #2490: create saves the holes from SEEK_HOLE in a pax record (ATE.holes), extract skips only zeros in these holes.
so zeros the workload wrote (like zero-filled wal) and fully fallocated files (like a swap file) stay allocated.
the tar itself is same as before, archive/tar can't write sparse entries. only the extracted file is sparse.
old tars have no record and restore dense like today. a release without this change ignores the record, so rollback still works.
gvisor doesn't use tarutil.
on ext4, a 1 GiB file with 64 MiB data takes 64 MiB after extract, not 1024 MiB. extract takes around 140 ms instead of 470 ms.
Fixes #2489
AI use: AI-assisted, i reviewed and tested it.