Skip to content

[release/2.3] overlay: don't override a configured index mount option - #14492

Merged
mxpv merged 1 commit into
containerd:release/2.3from
k8s-infra-cherrypick-robot:cherry-pick-13805-to-release/2.3
Oct 30, 2026
Merged

mxpv merged 1 commit into
containerd:release/2.3from
k8s-infra-cherrypick-robot:cherry-pick-13805-to-release/2.3

Conversation

@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

This is an automated cherry-pick of #13805

/assign chrishenzie

Avoid overriding user-configured index mount option in overlayfs snapshotter

NewSnapshotter auto-appends "index=off" unless the configured
mount_options already carry an index option — but the check used
hasOption(..., "index", false), which compares against the literal
string "index". No valid mount option ever equals "index" (it is
always valued, "index=on"/"index=off"), so the append happened
unconditionally whenever the kernel exposes the overlay index
parameter.

Mount options are last-wins in the kernel, so a user-configured
"index=on" was silently overridden. Worse, configuring
mount_options = ["index=on", "nfs_export=on"] (the documented way to
make overlay mounts NFS-exportable) produced
"index=on,nfs_export=on,index=off", which the kernel rejects with
EINVAL (nfs_export=on conflicts with an explicit index=off) — breaking
every snapshot mount including image unpack.

Make hasOption match the key of a "key[=value]" option so callers need
not care whether the option takes a value, and add a regression test.

Signed-off-by: AprilNEA <[email protected]>

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Oct 29, 2026
@mxpv
mxpv merged commit 1c81181 into containerd:release/2.3 Oct 30, 2026
50 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants