From 63854b0ea86549e1ea0982fc513ea4c27e073595 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 7 May 2020 18:27:53 -0700 Subject: [PATCH] newSetnsProcess: reuse state.CgroupPaths c.cgroupManager.GetPaths() are called twice here: once in currentState() and then in newSetnsProcess(). Reuse the result of the first call, which is stored into state.CgroupPaths. Signed-off-by: Kir Kolyshkin --- libcontainer/container_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go index 22fe69e8c..d4cc35d4d 100644 --- a/libcontainer/container_linux.go +++ b/libcontainer/container_linux.go @@ -553,7 +553,7 @@ func (c *linuxContainer) newSetnsProcess(p *Process, cmd *exec.Cmd, messageSockP } return &setnsProcess{ cmd: cmd, - cgroupPaths: c.cgroupManager.GetPaths(), + cgroupPaths: state.CgroupPaths, rootlessCgroups: c.config.RootlessCgroups, intelRdtPath: state.IntelRdtPath, messageSockPair: messageSockPair,