Repository navigation
fix(snapshot): set ext4 lost+found to 0755 (#177) - #178
Merged
Merged
Conversation
tar2ext4 (hcsshim compactext4) creates lost+found as root-owned 0700, so a tool walking a volume-mounted snapshot as non-root (e.g. MetaPhlAn's `find -L <db>`) emits a spurious `Permission denied` on lost+found. Prepend a lost+found/ dir tar entry at 0755 before Convert — the writer re-applies the mode when the directory entry repeats — overriding the default without re-muxing the source. Surfaced validating nf-spawn#55. Fixes #177
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Cosmetic fix surfaced validating nf-spawn#55 (zero-copy DBs on read-only EBS volumes).
Problem:
tar2ext4(hcsshimcompactext4) creates the ext4lost+founddirectory root-owned, mode0700. A tool that walks a volume-mounted snapshot as a non-root user emits a spurious stderr line — e.g. MetaPhlAn'sfind -L metaphlan→find: 'metaphlan/lost+found': Permission denied. Harmless (findstill resolves the content) but confusing in logs.Fix:
prependLostFoundinjects a singlelost+found/directory tar entry at mode0755ahead of the source tar stream beforetar2ext4.Convert. The writer re-applies the mode when alost+founddirectory entry repeats (confirmed by hcsshim's owncompact_test.go), so this overrides the default without re-muxing the (possibly very large) source archive. Only a tar header is written (Flush, notClose, so no archive trailer precedes the real stream).Tests:
TestPrependLostFoundasserts the combined stream islost+found/(dir, 0755) followed by the original entry intact, ending cleanly at EOF. The existingTestPrepareSnapshotImage_*ext4-build tests still pass (the prepend doesn't break Convert).Fixes #177. Pairs with nf-spawn#61 (doc note: volumes remove the copy, not the RAM footprint).