Skip to content
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

Docker.py: Pass the use_ino option to fix hardlnks #455

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

owtaylor
Copy link

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

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
# - On different partitions
# - With the same inode number
#
# Then the groups will be incorrectly merged in the output image. This

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hard link disappeared when built docker image
2 participants