Docker.py: Pass the use_ino option to fix hardlnks#455
Open
owtaylor wants to merge 1 commit into
Open
Conversation
When use libguestfs to mount the intermediate image to create a tarball, pass the "use_ino" option so that original inode numbers are preserved. This fixes a problem where hardlinks were not properly preserved in the output. This is a minimal-code-change fix - an edge case bug and better approach are described in comments. Resolves redhat-imaging#412
halfline
reviewed
Oct 20, 2023
| # - On different partitions | ||
| # - With the same inode number | ||
| # | ||
| # Then the groups will be incorrectly merged in the output image. This |
There was a problem hiding this comment.
too bad there isn't a derive_ino option or something that would hash the underlying st_ino and st_dev together. I guess the mounting could also do a 1-to-1 guestfs_handle.mount_local call for every g.mount_options call in launch_inspect_and_mount so tar would see the separate file systems as separate. anyway, like you said, tar_out_opts clearly seems like the best "right" answer and use_ino seems like the best "right now" answer.
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.
When use libguestfs to mount the intermediate image to create a tarball, pass the "use_ino" option so that original inode numbers are preserved. This fixes a problem where hardlinks were not properly preserved in the output.
This is a minimal-code-change fix - an edge case bug and better approach are described in comments.
Resolves #412