Repository navigation
NAR: the eager walk reads exactly the size the open file reports, as upstream's dump does - #115
Merged
Merged
Conversation
AniAthena
force-pushed
the
nar/eager-read-recorded-size
branch
from
December 4, 2026 19:43
8ab4287 to
0be8623
Compare
AniAthena
marked this pull request as ready for review
December 4, 2026 19:43
…upstream's dump does
AniAthena
force-pushed
the
nar/eager-read-recorded-size
branch
from
December 4, 2026 20:09
0be8623 to
e4d743d
Compare
aoinoikaz
approved these changes
Dec 4, 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.
The eager walk read a regular file with
BS.readFile, to end of input, so an entry replaced by a FIFO between itslstatand its read, or a file that changed while it was read, was archived with whatever the read returned. Upstream's dump reads exactly the size it recorded and fails if the file ends early (archive.cc).readFileBytesnow opens the file, reads its size from the handle and reads exactly that many bytes, refusing an early end, andhFileSizerefuses an open that finds no regular file, as the stream already does. The walk asks the executable-bit resolver before the read, in the stream's order, and a test uses that resolver to swap the file for a FIFO between the classification and the read.Neither walk opens with
O_NOFOLLOWas upstream does, so a file swapped for a symlink to another regular file is still read through the link; that is the same in the stream and is left for a change to both.Closes #106