container-export: Handle metacopy=off overlay setups#2097
Open
cgwalters wants to merge 1 commit intobootc-dev:mainfrom
Open
container-export: Handle metacopy=off overlay setups#2097cgwalters wants to merge 1 commit intobootc-dev:mainfrom
cgwalters wants to merge 1 commit intobootc-dev:mainfrom
Conversation
This fixes a bug in `container export` on overlayfs setups with `metacopy=off` (a common setup). In that scenario we will see a single mountpoint, but different device+inode. Change hardlink tracking to account for device+inode. Assisted-by: OpenCode (Claude Opus 4) Signed-off-by: Colin Walters <walters@verbum.org>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the hardlink tracking logic in container_export.rs to use a combination of device ID and inode number as the key, rather than just the inode. This change accommodates overlay filesystems where device numbers may differ between directories and files. Additionally, the explicit check for an expected device ID has been removed. I have no feedback to provide.
jeckersb
reviewed
Mar 26, 2026
| let filename_path = Path::new(filename); | ||
| let metadata = dir.metadata(filename_path)?; | ||
|
|
||
| // Skip files on different devices (e.g., bind mounts in containers like /etc/hosts). |
Collaborator
There was a problem hiding this comment.
Does this mean that now we would start including the bind-mounted /etc/hosts when we export?
Collaborator
Author
There was a problem hiding this comment.
As documented, this expects the image as a separate mount point:
podman run --rm \
--mount=type=image,source=quay.io/example/example,target=/run/target \
quay.io/example/example \
bootc container export --kernel-in-boot /run/target > example.tar
And in that case, there won't be any container runtime injected content like /etc/hosts.
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.
This fixes a bug in
container exporton overlayfs setups withmetacopy=off(a common setup). In that scenario we will see a single mountpoint, but different device+inode.Change hardlink tracking to account for device+inode.
Assisted-by: OpenCode (Claude Opus 4)