From d02fc48422c7f4371565f05e1406e5fab764e3c8 Mon Sep 17 00:00:00 2001 From: Ted Yu Date: Wed, 1 Apr 2020 15:45:31 -0700 Subject: [PATCH] isPathInPrefixList return value should be reverted Signed-off-by: Ted Yu --- libcontainer/container_linux.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go index aa150244e..4d3f03e80 100644 --- a/libcontainer/container_linux.go +++ b/libcontainer/container_linux.go @@ -1199,10 +1199,10 @@ func (c *linuxContainer) makeCriuRestoreMountpoints(m *configs.Mount) error { func isPathInPrefixList(path string, prefix []string) bool { for _, p := range prefix { if strings.HasPrefix(path, p+"/") { - return false + return true } } - return true + return false } // prepareCriuRestoreMounts tries to set up the rootfs of the @@ -1224,7 +1224,7 @@ func (c *linuxContainer) prepareCriuRestoreMounts(mounts []*configs.Mount) error // if the mountpoints are not on a tmpfs, as CRIU will // restore the complete tmpfs content from its checkpoint. for _, m := range mounts { - if isPathInPrefixList(m.Destination, tmpfs) { + if !isPathInPrefixList(m.Destination, tmpfs) { if err := c.makeCriuRestoreMountpoints(m); err != nil { return err }