Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/1.5] Fix panic in metadata content writer on copy error #6045

Merged

Conversation

dmcgowan
Copy link
Member

The createAndCopy function is only called when nw.w is nil
in order to create a new writer and prepare it. The current code
is attempting to close nw.w when there is a copy error. The
correct behavior would be to close the new writer and not touch nw.w.

Signed-off-by: Derek McGowan derek@mcg.dev
(cherry picked from commit b9cf0d7)
Signed-off-by: Derek McGowan derek@mcg.dev

The `createAndCopy` function is only called when `nw.w` is nil
in order to create a new writer and prepare it. The current code
is attempting to close `nw.w` when there is a copy error. The
correct behavior would be to close the new writer and not touch `nw.w`.

Signed-off-by: Derek McGowan <derek@mcg.dev>
(cherry picked from commit b9cf0d7)
Signed-off-by: Derek McGowan <derek@mcg.dev>
@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 23, 2021

Build succeeded.

Copy link
Member

@Zyqsempai Zyqsempai left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

@estesp estesp merged commit 0631957 into containerd:release/1.5 Sep 24, 2021
@thaJeztah
Copy link
Member

backport of #6043

@dmcgowan dmcgowan deleted the 1.5-fix-metadata-content-panic branch March 23, 2022 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants