Skip to content

Tweak mount info for overlayfs in case of parallel unpack#13115

Merged
mxpv merged 2 commits into
containerd:mainfrom
henry118:bug-13030-2
Mar 25, 2026
Merged

Tweak mount info for overlayfs in case of parallel unpack#13115
mxpv merged 2 commits into
containerd:mainfrom
henry118:bug-13030-2

Conversation

@henry118

Copy link
Copy Markdown
Member

Fixes: #13030

Alternative to: #13044

Instead of changing overlay snapshotter itself, this PR updates unpacker logic to tweak the mount info returned by overlay in the parallel case.

Signed-off-by: Henry Wang <henwang@amazon.com>
Signed-off-by: Henry Wang <henwang@amazon.com>

@dmcgowan dmcgowan 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.

This is cleaner

@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Mar 25, 2026
@dmcgowan dmcgowan added this pull request to the merge queue Mar 25, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 25, 2026
@mxpv mxpv added this pull request to the merge queue Mar 25, 2026
Merged via the queue into containerd:main with commit 546ce38 Mar 25, 2026
54 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Mar 25, 2026
@samuelkarp samuelkarp added the cherry-pick/2.2.x Change to be cherry picked to release/2.2 branch label Mar 25, 2026
@samuelkarp

Copy link
Copy Markdown
Member

/cherrypick release/2.2

@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

@samuelkarp: new pull request created: #13125

Details

In response to this:

/cherrypick release/2.2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@henry118 henry118 deleted the bug-13030-2 branch March 26, 2026 17:43
@chrishenzie chrishenzie added cherry-picked/2.2.x PR commits are cherry-picked into release/2.2 branch and removed cherry-pick/2.2.x Change to be cherry picked to release/2.2 branch labels Apr 14, 2026
Comment thread core/unpack/unpacker.go
m.Options = append(m.Options, o)
}
}
m.Options = append(m.Options, "upperdir="+mounts[0].Source)

@AkihiroSuda AkihiroSuda May 12, 2026

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.

How does this work without specifying lowerdir?

$ sudo mount -t overlay -o ro,upperdir=/tmp/foo overlay /tmp/bar/
mount: /tmp/bar: wrong fs type, bad option, bad superblock on overlay, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.

$ sudo dmesg
[...]
[ 3499.690103] overlayfs: missing 'lowerdir'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It relies on the following logic in the applier:

case len(mounts) == 1 && mounts[0].Type == "overlay":
// OverlayConvertWhiteout (mknod c 0 0) doesn't work in userns.
// https://github.com/containerd/containerd/issues/3762
if userns.RunningInUserNS() {
break
}
path, parents, err := getOverlayPath(mounts[0].Options)
if err != nil {
if errdefs.IsInvalidArgument(err) {
break
}
return err
}
opts := []archive.ApplyOpt{
archive.WithConvertWhiteout(archive.OverlayConvertWhiteout),
}
if len(parents) > 0 {
opts = append(opts, archive.WithParents(parents))
}
_, err = archive.Apply(ctx, path, r, opts...)
if err == nil && sync {
err = doSyncFs(path)
}
return err

This code path does not perform actual fs mount.

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.

Thanks

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

Labels

cherry-picked/2.2.x PR commits are cherry-picked into release/2.2 branch kind/bug size/L

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

whiteout files not honored by max_concurrent_unpacks > 1

9 participants