Skip to content

cri: don't leak the new mount if mutateImageMount() fails - #13656

Merged
mxpv merged 1 commit into
containerd:mainfrom
erofs:cri-image-volume
Jun 23, 2026
Merged

mxpv merged 1 commit into
containerd:mainfrom
erofs:cri-image-volume

Conversation

@hsiangkao

Copy link
Copy Markdown
Member

Found by Copilot when fixing #13542

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.

Pull request overview

This PR updates CRI image-volume mounting cleanup so that, when a new image volume mount is created during mutateImageMount() and the function later returns an error, the mount is unmounted to avoid leaking mounts on the node.

Changes:

  • Add a deferred unmount (mount.UnmountAll) after successfully mounting a newly-prepared image volume, gated on retErr != nil.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Jun 23, 2026
@mxpv
mxpv added this pull request to the merge queue Jun 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 23, 2026
@mxpv
mxpv added this pull request to the merge queue Jun 23, 2026
Merged via the queue into containerd:main with commit 33fb482 Jun 23, 2026
50 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Jun 23, 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.

4 participants