mz978: key hardlink tracking by device and inode - #979
Open
mzihlmann wants to merge 2 commits into
Open
Conversation
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
mzihlmann
force-pushed
the
2595-hardlinks
branch
from
August 12, 2026 07:10
193b564 to
43cbc74
Compare
mzihlmann
force-pushed
the
mz978-hardlink-dev-inode
branch
from
August 12, 2026 07:10
de943e8 to
cab920a
Compare
mzihlmann
force-pushed
the
2595-hardlinks
branch
from
August 12, 2026 09:42
43cbc74 to
9a379af
Compare
mzihlmann
force-pushed
the
mz978-hardlink-dev-inode
branch
from
August 12, 2026 09:42
cab920a to
2e0a3e7
Compare
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.
Fixes #978
Hardlink tracking keyed its seen-map by inode number alone, in
checkCopyHardlinkfor the copy path and inTar.checkHardlinkfor the snapshot path. An inode number is only unique within one filesystem, so aCOPYof a tree that spans a mount point could match two unrelated files and hardlink them together, leaving one with the other's content. Nothing failed loudly, because the link target is a destination path already written and both ends sit on the destination filesystem, so there is no EXDEV to catch. Both maps now key on{dev, ino}, fixed together so the two implementations do not drift apart again.No feature flag. Per
docs/releases.mda fix for behaviour that produced corrupt images has no stable behaviour to protect, and gating it would mean shipping known content corruption behind an opt-in.The bug predates this stack and reproduces on main through
COPYfrom the build context, butFF_KANIKO_NATIVE_COPYwidens it considerably: it routes the multistage save path throughcopyDirInner, and that one walks the source stage's live rootfs, which always spans several filesystems. That is why this is stacked ahead of the flag graduating to default in v1.29.0, and why the test usesCOPY --from.Getting a deterministic collision turned out not to need privileges. Two tmpfs mounts do it, since a tmpfs numbers its inodes per superblock, so each mount hands its first file inode 2.
extraDockerRunFlagsalready existed for per-test docker run flags, so no harness change was needed. Only the executor gets the mounts, so the docker half of the comparison keeps one filesystem and stays correct, and diffoci names the defect directly rather than a shell assertion returning a bare exit code: