From 455b5fdd435eb438f5eceee675745e53f91e651e Mon Sep 17 00:00:00 2001 From: allencloud Date: Sun, 2 Oct 2016 00:22:23 +0800 Subject: [PATCH] add lock in libcontainerd client AddProcess Signed-off-by: allencloud Upstream-commit: 278273bc1699873304240a6eca342b54051e2f23 Component: engine --- components/engine/libcontainerd/client_linux.go | 1 + components/engine/libcontainerd/types_linux.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/engine/libcontainerd/client_linux.go b/components/engine/libcontainerd/client_linux.go index 680edc713c..b180e00205 100644 --- a/components/engine/libcontainerd/client_linux.go +++ b/components/engine/libcontainerd/client_linux.go @@ -101,6 +101,7 @@ func (clnt *client) AddProcess(ctx context.Context, containerID, processFriendly clnt.unlock(containerID) if err := clnt.backend.AttachStreams(processFriendlyName, *iopipe); err != nil { + clnt.lock(containerID) return err } clnt.lock(containerID) diff --git a/components/engine/libcontainerd/types_linux.go b/components/engine/libcontainerd/types_linux.go index 8cd2393ab6..cc2a17aec6 100644 --- a/components/engine/libcontainerd/types_linux.go +++ b/components/engine/libcontainerd/types_linux.go @@ -22,9 +22,9 @@ type Process struct { Capabilities []string `json:"capabilities,omitempty"` // Rlimits specifies rlimit options to apply to the process. Rlimits []specs.Rlimit `json:"rlimits,omitempty"` - // ApparmorProfile specified the apparmor profile for the container. + // ApparmorProfile specifies the apparmor profile for the container. ApparmorProfile *string `json:"apparmorProfile,omitempty"` - // SelinuxProcessLabel specifies the selinux context that the container process is run as. + // SelinuxLabel specifies the selinux context that the container process is run as. SelinuxLabel *string `json:"selinuxLabel,omitempty"` }