cmd/snap-confine: aggregate operations holding global lock #3262

Merged
merged 2 commits into from May 12, 2017

Conversation

Projects
None yet
3 participants
Contributor

zyga commented May 2, 2017

This patch moves the code that ensures /snap is rshared next to smilar
operation that initializes the bind mount at /run/snapd/ns. This allows
us to hold avoid one lock/unlock pair. The code is also only running if
non-classic-confinement snaps are in operation. Since classic
confinement snaps don't use any namespaces they don't rely on the /snap
directory being rshared.

Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@canonical.com

zyga added some commits May 2, 2017

cmd/snap-confine: aggregate operations holding global lock
This patch moves the code that ensures /snap is rshared next to smilar
operation that initializes the bind mount at /run/snapd/ns. This allows
us to hold avoid one lock/unlock pair. The code is also only running if
non-classic-confinement snaps are in operation. Since classic
confinement snaps don't use any namespaces they don't rely on the /snap
directory being rshared.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

@zyga zyga requested a review from mvo5 May 11, 2017

mvo5 approved these changes May 12, 2017

LGTM, we just need to make sure that if we ever change the semantic of classic (to use namespaces) we ensure the shared property moves back to the top. But I guess we need to touch more code in this case so its ok.

Contributor

morphis commented May 12, 2017

LGTM

@mvo5 mvo5 merged commit 49fcb6c into snapcore:master May 12, 2017

7 checks passed

artful-amd64 autopkgtest finished (success)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-amd64 autopkgtest finished (success)
Details
xenial-i386 autopkgtest finished (success)
Details
xenial-ppc64el autopkgtest finished (success)
Details
yakkety-amd64 autopkgtest finished (success)
Details
zesty-amd64 autopkgtest finished (success)
Details

@zyga zyga deleted the zyga:tweak/do-all-global-init-at-once branch May 12, 2017

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