Preserve extra overlayfs mount options when loading many-layered images#1156
Merged
rhatdan merged 1 commit intocontainers:mainfrom Feb 28, 2022
kousu:userxattr-even-on-large-images
Merged
Preserve extra overlayfs mount options when loading many-layered images#1156rhatdan merged 1 commit intocontainers:mainfrom kousu:userxattr-even-on-large-images
rhatdan merged 1 commit intocontainers:mainfrom
kousu:userxattr-even-on-large-images
Conversation
kousu
commented
Feb 28, 2022
Comment on lines
+1535
to
+1537
| if len(optsList) > 0 { | ||
| opts = fmt.Sprintf("%s,%s", opts, strings.Join(optsList, ",")) | ||
| } |
Author
There was a problem hiding this comment.
This part is the fix. The rest of the patch is just supporting changes for this line.
When overlayfs loads a container image that has many layers, each becomes an extra argument to the 'lowerdir' list, and if it has many many many of them it will try to squeeze more in by rewriting them as relative paths. Unfortunately, this case was forgetting 'userxattr' and 'volatile' and any other user-supplied mount options. It meant that in rootless mode (which needs userxattr to behave properly) you'd get an EXDEV error anytime you tried to rename() a directory. Fixes containers/podman#13123 Signed-off-by: Nick Guenther <nick.guenther@polymtl.ca>
flouthoc
approved these changes
Feb 28, 2022
Collaborator
flouthoc
left a comment
There was a problem hiding this comment.
Code looks good to me. Just need to try it once.
@containers/storage-maintainers PTAL
Collaborator
|
or a dummy PR against |
Member
|
@giuseppe PTAL |
Member
|
Thanks @kousu |
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.
When overlayfs loads a container image that has many layers, each becomes an extra argument to the 'lowerdir' list, and if it has many many many of them it will try to squeeze more in by rewriting them as relative paths.
Unfortunately, this case was forgetting 'userxattr' and 'volatile' and any other user-supplied mount options, which meant that in rootless mode (which needs userxattr to behave properly) you'd get an EXDEV error anytime you tried to rename() a directory.
This swaps a couple steps around to make it easier to make both cases the same.
This should fix containers/podman#13123, but I haven't actually tested it yet because I haven't figured out how. But I traced enough out to spot the bug and wanted to get some code up before I forgot it.
Cheers!