Visitar URL original
mount: preserve data-only lowerdir separators by mike-sul · Pull Request #14539 · containerd/containerd · GitHub
Skip to content

mount: preserve data-only lowerdir separators - #14539

Open
mike-sul wants to merge 1 commit into
containerd:mainfrom
mike-sul:fix/mount-data-only-lowerdir
Open

mike-sul wants to merge 1 commit into
containerd:mainfrom
mike-sul:fix/mount-data-only-lowerdir

Conversation

@mike-sul

@mike-sul mike-sul commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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.

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>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 10:29
@github-project-automation github-project-automation Bot moved this to Needs Triage in Pull Request Review Nov 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants