Repository navigation
Conversation
Overlayfs (6.5+) accepts "::" in lowerdir to introduce data-only lower layers, but the option is split on ":" and the resulting empty element is treated as a path. Compaction then finds no common prefix and skips, so long options still fail with "mount options is too long", and an idmapped overlay mount fails with "no common prefix found". Skip the empty element when computing the common prefix and carry it through unchanged in both rewrites, so "::" survives; the idmapped rewrite would otherwise map it to the idmapped root and turn the data-only layers into regular lowers. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Mykhaylo Sul <mykhaylo.sul@oss.qualcomm.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the changes preserving Linux overlay data-only lower-layer separators.
No open issues 🎉
What changed in this PR
This PR updates Linux overlay mount handling to preserve :: data-only lower-layer separators, supporting snapshotters that return these options during ID mapping and long-option compaction.
Changes:
- Excludes empty separator elements from common-prefix calculations.
- Preserves separators when rewriting lower-layer paths.
- Adds regression tests for prefix calculation and both path rewrites.
| File | Description |
|---|---|
core/mount/mount_linux.go |
Filters separators from prefix calculations and preserves them in rewritten options. |
core/mount/mount_linux_test.go |
Adds data-only lower-layer regression cases for all three affected helpers. |
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.
Overlayfs (Linux 6.5+) supports
::data-only lowers. For snapshotters returning these mounts (none in-tree), treating the separator as a path breaks idmapped mounts ("no common prefix found") and long options ("mount options is too long").Exclude empty elements from prefix computation and preserve them in both rewrites.
Each added unit regression fails without the fix. A
mount.All()repro using :: with uidmap/gidmap or 150 lowers fails before and mounts after the fix on kernel 7.1.3.Developed with AI assistance; I reviewed and tested the change.