Skip to content

Commit

Permalink
Merge pull request #2283 from tedyu/runc-path-in-prefix
Browse files Browse the repository at this point in the history
isPathInPrefixList return value should be reverted
  • Loading branch information
crosbymichael authored Apr 2, 2020
2 parents b26e4f2 + d02fc48 commit 6ca9d8e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libcontainer/container_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -1204,10 +1204,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
Expand All @@ -1229,7 +1229,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
}
Expand Down

0 comments on commit 6ca9d8e

Please sign in to comment.