Repository navigation
mount: copy options before replacing lowerdir - #14551
Open
samuelkarp wants to merge 1 commit into
Open
samuelkarp wants to merge 1 commit into
samuelkarp wants to merge 1 commit into
Conversation
Mounting an overlay with ID mapping replaces its lowerdir option with temporary ID-mapped directories. The replacement was made in place, so it also changed the Mount the caller passed in. After the call, that Mount's lowerdir option listed temporary directories that were already unmounted. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Samuel Karp <me@samuelkarp.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the change intended to preserve caller-owned mount options during ID-mapped overlay mounting.
No open issues 🎉
What changed in this PR
Prevents ID-mapped overlay mounting from modifying the caller’s mount options and leaving them pointing to temporary directories that have already been unmounted.
Changes:
- Clones the options slice before replacing and appending the
lowerdiroption. - Adds a regression test verifying the replacement options and preservation of the original input.
| File | Description |
|---|---|
core/mount/mount_linux.go |
Extracts lowerdir replacement into a helper that copies options before modifying them. |
core/mount/mount_linux_test.go |
Tests lowerdir replacement and verifies that caller-owned options remain unchanged. |
Review effort: Balanced
This branch has not been deployed
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.
Mounting an overlay with ID mapping replaces its lowerdir option with temporary ID-mapped directories. The replacement was made in place, so it also changed the Mount the caller passed in. After the call, that Mount's lowerdir option listed temporary directories that were already unmounted.
Assisted-by: Claude Code:claude-opus-5-5