diff --git a/libpod/container_copy_common.go b/libpod/container_copy_common.go index 8d21c0f2ad..da16b2a91b 100644 --- a/libpod/container_copy_common.go +++ b/libpod/container_copy_common.go @@ -31,7 +31,7 @@ func (c *Container) copyFromArchive(path string, chown, noOverwriteDirNonDir boo unmount func() cleanupFuncs []func() err error - locked bool = true + locked = true ) // Make sure that "/" copies the *contents* of the mount point and not diff --git a/libpod/container_internal_common.go b/libpod/container_internal_common.go index 874e7fae2f..d9b7e33da0 100644 --- a/libpod/container_internal_common.go +++ b/libpod/container_internal_common.go @@ -788,12 +788,9 @@ func (c *Container) isWorkDirSymlink(resolvedPath string) bool { // If so, that's a valid use case: return nil. maxSymLinks := 0 - for { - // Linux only supports a chain of 40 links. - // Reference: https://github.com/torvalds/linux/blob/master/include/linux/namei.h#L13 - if maxSymLinks > 40 { - break - } + // Linux only supports a chain of 40 links. + // Reference: https://github.com/torvalds/linux/blob/master/include/linux/namei.h#L13 + for maxSymLinks <= 40 { resolvedSymlink, err := os.Readlink(resolvedPath) if err != nil { // End sym-link resolution loop. diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go index deec9d5deb..22ad3b5697 100644 --- a/libpod/oci_conmon_linux.go +++ b/libpod/oci_conmon_linux.go @@ -167,11 +167,7 @@ func (r *ConmonOCIRuntime) withContainerSocketLabel(ctr *Container, closure func // moveConmonToCgroupAndSignal gets a container's cgroupParent and moves the conmon process to that cgroup // it then signals for conmon to start by sending nonce data down the start fd func (r *ConmonOCIRuntime) moveConmonToCgroupAndSignal(ctr *Container, cmd *exec.Cmd, startFd *os.File) error { - mustCreateCgroup := true - - if ctr.config.NoCgroups { - mustCreateCgroup = false - } + mustCreateCgroup := !ctr.config.NoCgroups // If cgroup creation is disabled - just signal. switch ctr.config.CgroupsMode {