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

overlay: drop relLowers workaround #1411

Merged
merged 1 commit into from
Oct 27, 2022

Conversation

giuseppe
Copy link
Member

commit 7c5964d changed the way the mountFrom program works by always using the /proc/self/fd/%d path for the lower dirs. Hence there is no gain to pass a path relative to the storage, but we can just pass the absolute path as the resulting file path length is the same and won't affect how many layers we can specify.

This fixes idmapped mounts when the total length of lower layers is > 4096 and it also solves the problem of using layers from additional stores.

Closes: #1410

Signed-off-by: Giuseppe Scrivano [email protected]

commit 7c5964d changed the way the
mountFrom program works by always using the /proc/self/fd/%d path for
the lower dirs.  Hence there is no gain to pass a path relative to the
storage, but we can just pass the absolute path as the resulting file
path length is the same and won't affect how many layers we can
specify.

This fixes idmapped mounts when the total length of lower layers is >
4096 and it also solves the problem of using layers from additional
stores.

Closes: containers#1410

Signed-off-by: Giuseppe Scrivano <[email protected]>
@giuseppe
Copy link
Member Author

@nalind @rhatdan PTAL

@rhatdan
Copy link
Member

rhatdan commented Oct 25, 2022

@nalind
Copy link
Member

nalind commented Oct 25, 2022

This means we'll fork to do the mount in a child more often than we do now.
We should have switched to always using absolute paths for layers in additional stores in #1375.

@giuseppe
Copy link
Member Author

The issue happened with an image that has many layers. I think it is fine for now to simplify the code if the additional cost happens only with these images

Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

  • It’s completely unclear to me how this is fixing anything. Was the relative-path code buggy in some way WRT additional stores?
  • If this code is code the primary reason for creating the link symlink forest, should we actually drop all users of it? There are some left.
  • … and show we stop creating the symlinks at all? (Would that break older-version readers, or would they workaround via recreateSymlink? And if it would break them, do we need to care, or is one-directional compatibility sufficient?)

@giuseppe
Copy link
Member Author

  • It’s completely unclear to me how this is fixing anything. Was the relative-path code buggy in some way WRT additional stores?

when idmapped mounts are used, we were just rewriting the absolute lower dirs, but not updating the relLowers. This is probably not possible since the idmapped mounts use a subdirectory where the idmapped bind mount is created, thus the relative dirs in link won't work.

  • If this code is code the primary reason for creating the link symlink forest, should we actually drop all users of it? There are some left.
  • … and show we stop creating the symlinks at all? (Would that break older-version readers, or would they workaround via recreateSymlink? And if it would break them, do we need to care, or is one-directional compatibility sufficient?)

I had a quick look at it, and it seems the link file is still used by getLower and to point to layers into additional stores so we would first need to fix these two other occurrences.

@mtrmac
Copy link
Collaborator

mtrmac commented Oct 25, 2022

when idmapped mounts are used, we were just rewriting the absolute lower dirs, but not updating the relLowers.

Ah. Thanks for writing that down.

@giuseppe
Copy link
Member Author

can we move this forward or is there anything blocking I should take care of?

@mtrmac
Copy link
Collaborator

mtrmac commented Oct 27, 2022

The implementation LGTM.

As for the PR as a whole, do we want to drop all of the link data structure now, or not? I don’t feel qualified to have an opinion.

@rhatdan
Copy link
Member

rhatdan commented Oct 27, 2022

If we need to drop all of the link data structure now, or not
we can do it in a separate PR.
LGTM

@rhatdan rhatdan merged commit 1736ed5 into containers:main Oct 27, 2022
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.

Rootful podman with --userns=auto fails
4 participants