New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handle modified hardlinks to /sysroot
#405
Comments
cgwalters
added a commit
to cgwalters/ostree-rs-ext
that referenced
this issue
Nov 11, 2022
xref ostreedev#405 This test case reproduces the failure when we're trying to import a tar archive with hardlinks into `/sysroot`.
cgwalters
added a commit
to cgwalters/ostree-rs-ext
that referenced
this issue
Nov 11, 2022
xref ostreedev#405 This test case reproduces the failure when we're trying to import a tar archive with hardlinks into `/sysroot`.
cgwalters
added a commit
to cgwalters/ostree-rs-ext
that referenced
this issue
Nov 11, 2022
xref ostreedev#405 This test case reproduces the failure when we're trying to import a tar archive with hardlinks into `/sysroot`.
cgwalters
added a commit
to cgwalters/ostree-rs-ext
that referenced
this issue
Nov 11, 2022
Some container build processes run without overlayfs inode indexing on - in this common scenario, overlayfs is not quite POSIX compliant because it will break the hardlink instead of modifying all versions. We need to handle this case of having *all* names for a hardlinked file being modified though too. If the serialized tar stream has the file in `/sysroot` be the canonical version, then because we drop out that file here, we'll fail to import. Fix this by significantly beefing up the tar filtering/reprocessing logic: - When we see a *modified* file in `/sysroot` with a nonzero timestamp, cache its data into a lookaside temporary directory - If we then see a hardlink to that file path, make *that* file be the canonical version in e.g. `/usr`. - Any further hardlinks to `/sysroot` instead become hardlinks to the new canonical one. (Arguably perhaps...we should actually not have used hardlinks in ostree containers at all, but injected this metadata in some other way. But, the ship has sailed on that) Closes: ostreedev#405
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Today this:
When built using e.g. the
redhat-actions/buildah-build@v2Github action, seems to result in a tar stream that looks like this:But that causes problems because when importing layered builds, we discard content in
/sysrootentirely.I think this has something to do with the use of the overlayfs driver versus vfs. I believe with the kernel overlayfs, modifying a hardlinked file will result in a copyup of just that single file; it explicitly will not mutate all targets of that link. From the docs:
I can think of two fixes:
ostree container commit, we can actually nuke everything in/sysroot- or at least just files whose timestamp is newer than the epoch. This would result in whiteout files in the serialized stream, which the import path will just ignore./usr/lib/ostree/modified-objects/$digestand rewriting the links?It may make sense to do both.
The text was updated successfully, but these errors were encountered: