Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

runtime: Don' call bindUnmountContainerRootfs if container's rootfs u… #2915

Merged
merged 1 commit into from
Oct 19, 2020

Conversation

keloyang
Copy link
Contributor

buildContainerRootfs don't call bindMountContainerRootfs if container's rootfs use devicemapper
device in https://github.com/kata-containers/runtime/blob/master/virtcontainers/kata_agent.go#L1300,
so bindUnmountContainerRootfs should not be called if container's rootfs use devicemapper device
in https://github.com/kata-containers/runtime/blob/master/virtcontainers/container.go#L1123

Fixes: #2914

Signed-off-by: Shukui Yang [email protected]

@cmaf
Copy link

cmaf commented Sep 8, 2020

/test-ubuntu

Copy link
Member

@fidencio fidencio left a comment

Choose a reason for hiding this comment

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

lgtm!

virtcontainers/container.go Outdated Show resolved Hide resolved
@fidencio
Copy link
Member

fidencio commented Sep 8, 2020

@bergwolf, do we have the same condition on the rust agent? If so, this PR must be forward-ported to the kata-containers/kata-containers branch.

For sure it also deserves a backport to the stable-1.11 branch as well.

@codecov
Copy link

codecov bot commented Sep 8, 2020

Codecov Report

Merging #2915 into master will increase coverage by 0.23%.
The diff coverage is 62.50%.

@@            Coverage Diff             @@
##           master    #2915      +/-   ##
==========================================
+ Coverage   51.44%   51.68%   +0.23%     
==========================================
  Files         118      118              
  Lines       17428    17440      +12     
==========================================
+ Hits         8966     9013      +47     
+ Misses       7379     7342      -37     
- Partials     1083     1085       +2     

@egernst
Copy link
Member

egernst commented Sep 9, 2020

Thanks for the change. I’m wondering if we should be augmenting our unit tests to exercise this. Any interest in helping with this @keloyang ?

@keloyang keloyang force-pushed the bindmount branch 2 times, most recently from 3ce7b97 to 522f3e0 Compare September 9, 2020 10:33
buildContainerRootfs don't call bindMountContainerRootfs if container's rootfs use devicemapper
device in https://github.com/kata-containers/runtime/blob/master/virtcontainers/kata_agent.go#L1300,
so bindUnmountContainerRootfs should not be called if container's rootfs use devicemapper device
in https://github.com/kata-containers/runtime/blob/master/virtcontainers/container.go#L1123

Fixes: #2914

Signed-off-by: Shukui Yang <[email protected]>
@keloyang
Copy link
Contributor Author

keloyang commented Sep 9, 2020

I'm happy to do this and I have change for this pr, PTAL, thanks. @egernst @fidencio

@devimc
Copy link

devimc commented Sep 9, 2020

/test

Copy link
Contributor

@jodh-intel jodh-intel left a comment

Choose a reason for hiding this comment

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

Thanks @keloyang.

Would you be able to forward-port this to Kata 2.0 too (https://github.com/kata-containers/kata-containers/tree/2.0-dev/src/runtime) ?

lgtm

@jodh-intel jodh-intel added backport Change from a newer branch / repository needs-backport Changes need to be applied to an older branch / repository needs-forward-port Changes need to be applied to a newer branch / repository and removed backport Change from a newer branch / repository labels Sep 10, 2020
@keloyang
Copy link
Contributor Author

ping @egernst @jodh-intel @fidencio

@fidencio
Copy link
Member

/retest

@cmaf
Copy link

cmaf commented Sep 30, 2020

@keloyang this is failing on 2 required checks ("jenkins-ci-ubuntu-18-04" and "jenkins-metrics-ubuntu-18-04") I'm seeing a 404 error instead of the results, so I'm retesting.

/test

@@ -351,7 +355,7 @@ func bindUnmountAllRootfs(ctx context.Context, sharedDir string, sandbox *Sandbo
if c.state.Fstype == "" {
Copy link
Member

Choose a reason for hiding this comment

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

This check here should prevent bindUnmountContainerRootfs from being called. If it were being called, the bindUnmountContainerRootfs call would have returned an error which would have been propogated up the stack.
Are you seeing otherwise?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amshinde thanks for your review. I think we still need this change. bindUnmountContainerRootfs is called in several places ,there is no check in https://github.com/kata-containers/runtime/blob/master/virtcontainers/container.go#L1123.
in addition,call bindUnmountContainerRootfs don't always return error, see https://github.com/kata-containers/runtime/blob/master/virtcontainers/mount.go#L329.

Copy link
Member

Choose a reason for hiding this comment

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

Ok fair enough.

@amshinde amshinde merged commit 37be079 into kata-containers:master Oct 19, 2020
@jodh-intel
Copy link
Contributor

forward port PR: kata-containers/kata-containers#940

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-backport Changes need to be applied to an older branch / repository needs-forward-port Changes need to be applied to a newer branch / repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don' call bindUnmountContainerRootfs if container's rootfs use devicemapper device
7 participants