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

fix hardlink filter regression #198

Merged
merged 1 commit into from
Apr 24, 2024
Merged

Conversation

tonistiigi
Copy link
Owner

fix moby/buildkit#4831

With the refactor to FilterFS the hardlink handling was changed so that the hardlink detection is in a separate FS instance and then FilterFS is layered on top of it. This means that the file that was the source for the hardlink could be filtered out, but the Stat pointing to that link is still sent as is.

New function validates if source files are not present in FS anymore and correct the linking. It could be better if all the FS implementation did this automatically, but there is quite a lot of layering going on atm. with multiple layers of FilterFS that would all need to keep own hardlink memory, so atm. the new function is only called before send.

With the refactor to FilterFS the hardlink handling
was changed so that the hardlink detection is in a
separate FS instance and then FilterFS is layered on
top of it. This means that the file that was the source
for the hardlink could be filtered out, but the Stat pointing
to that link is still sent as is.

New function validates if source files are not present in FS
anymore and correct the linking. It could be better if all
the FS implementation did this automatically, but there is
quite a lot of layering going on atm. with multiple layers
of FilterFS that would all need to keep own hardlink memory,
so atm. the new function is only called before send.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Copy link
Collaborator

@jedevc jedevc left a comment

Choose a reason for hiding this comment

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

LGTM, it looks like there are only two FS implementations that remove files from a base FS - FilterFS and SubDirFS. I think this is probably the easiest fix right now though.

@jedevc jedevc merged commit 91a3fc4 into master Apr 24, 2024
14 checks passed
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.

Error when multiple hardlinked files are in the context directory on Linux on v0.13.0 and later
2 participants