diff options
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | go.sum | 2 | ||||
-rw-r--r-- | libpod/image/layer_tree.go | 15 | ||||
-rw-r--r-- | vendor/github.com/containers/storage/.cirrus.yml | 2 | ||||
-rw-r--r-- | vendor/github.com/containers/storage/VERSION | 2 | ||||
-rw-r--r-- | vendor/github.com/containers/storage/drivers/overlay/overlay.go | 27 | ||||
-rw-r--r-- | vendor/modules.txt | 2 |
7 files changed, 41 insertions, 11 deletions
@@ -15,7 +15,7 @@ require ( github.com/containers/conmon v2.0.20+incompatible github.com/containers/image/v5 v5.10.2 github.com/containers/psgo v1.5.2 - github.com/containers/storage v1.24.5 + github.com/containers/storage v1.24.6 github.com/coreos/go-systemd/v22 v22.1.0 github.com/cri-o/ocicni v0.2.1-0.20201204103948-b6cbe99b9756 github.com/cyphar/filepath-securejoin v0.2.2 @@ -120,6 +120,8 @@ github.com/containers/psgo v1.5.2/go.mod h1:2ubh0SsreMZjSXW1Hif58JrEcFudQyIy9EzP github.com/containers/storage v1.23.7/go.mod h1:cUT2zHjtx+WlVri30obWmM2gpqpi8jfPsmIzP1TVpEI= github.com/containers/storage v1.24.5 h1:BusfdU0rCS2/Daa/DPw+0iLfGRlYA7UVF7D0el3N7Vk= github.com/containers/storage v1.24.5/go.mod h1:YC+2pY8SkfEAcZkwycxYbpK8EiRbx5soPPwz9dxe4IQ= +github.com/containers/storage v1.24.6 h1:9PBb9PoGuj5B/3MGfxx//RmUjMAklmx3rBbuCkuIc94= +github.com/containers/storage v1.24.6/go.mod h1:YC+2pY8SkfEAcZkwycxYbpK8EiRbx5soPPwz9dxe4IQ= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-iptables v0.4.5 h1:DpHb9vJrZQEFMcVLFKAAGMUVX0XoRC0ptCthinRYm38= diff --git a/libpod/image/layer_tree.go b/libpod/image/layer_tree.go index 18101575e..dde39dba1 100644 --- a/libpod/image/layer_tree.go +++ b/libpod/image/layer_tree.go @@ -5,6 +5,7 @@ import ( ociv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) // layerTree is an internal representation of local layers. @@ -84,7 +85,12 @@ func (ir *Runtime) layerTree() (*layerTree, error) { } node, exists := tree.nodes[topLayer] if !exists { - return nil, errors.Errorf("top layer %s of image %s not found in layer tree", img.TopLayer(), img.ID()) + // Note: erroring out in this case has turned out having been a + // mistake. Users may not be able to recover, so we're now + // throwing a warning to guide them to resolve the issue and + // turn the errors non-fatal. + logrus.Warnf("Top layer %s of image %s not found in layer tree. The storage may be corrupted, consider running `podman system reset`.", topLayer, img.ID()) + continue } node.images = append(node.images, img) } @@ -107,7 +113,12 @@ func (t *layerTree) children(ctx context.Context, parent *Image, all bool) ([]st parentNode, exists := t.nodes[parent.TopLayer()] if !exists { - return nil, errors.Errorf("layer not found in layer tree: %q", parent.TopLayer()) + // Note: erroring out in this case has turned out having been a + // mistake. Users may not be able to recover, so we're now + // throwing a warning to guide them to resolve the issue and + // turn the errors non-fatal. + logrus.Warnf("Layer %s not found in layer. The storage may be corrupted, consider running `podman system reset`.", parent.TopLayer()) + return children, nil } parentID := parent.ID() diff --git a/vendor/github.com/containers/storage/.cirrus.yml b/vendor/github.com/containers/storage/.cirrus.yml index cc2dd7952..7d43b244b 100644 --- a/vendor/github.com/containers/storage/.cirrus.yml +++ b/vendor/github.com/containers/storage/.cirrus.yml @@ -25,7 +25,7 @@ env: # GCE project where images live IMAGE_PROJECT: "libpod-218412" # VM Image built in containers/automation_images - _BUILT_IMAGE_SUFFIX: "c6233039174893568" + _BUILT_IMAGE_SUFFIX: "c6524344056676352" FEDORA_CACHE_IMAGE_NAME: "fedora-${_BUILT_IMAGE_SUFFIX}" PRIOR_FEDORA_CACHE_IMAGE_NAME: "prior-fedora-${_BUILT_IMAGE_SUFFIX}" UBUNTU_CACHE_IMAGE_NAME: "ubuntu-${_BUILT_IMAGE_SUFFIX}" diff --git a/vendor/github.com/containers/storage/VERSION b/vendor/github.com/containers/storage/VERSION index 6521720b4..7a429d68a 100644 --- a/vendor/github.com/containers/storage/VERSION +++ b/vendor/github.com/containers/storage/VERSION @@ -1 +1 @@ -1.24.5 +1.24.6 diff --git a/vendor/github.com/containers/storage/drivers/overlay/overlay.go b/vendor/github.com/containers/storage/drivers/overlay/overlay.go index 6e5a76cf3..a2209db8e 100644 --- a/vendor/github.com/containers/storage/drivers/overlay/overlay.go +++ b/vendor/github.com/containers/storage/drivers/overlay/overlay.go @@ -125,6 +125,15 @@ func init() { graphdriver.Register("overlay2", Init) } +func hasMetacopyOption(opts []string) bool { + for _, s := range opts { + if s == "metacopy=on" { + return true + } + } + return false +} + // Init returns the a native diff driver for overlay filesystem. // If overlay filesystem is not supported on the host, a wrapped graphdriver.ErrNotSupported is returned as error. // If an overlay filesystem is not supported over an existing filesystem then a wrapped graphdriver.ErrIncompatibleFS is returned. @@ -863,7 +872,17 @@ func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountO } readWrite := true - for _, o := range options.Options { + optsList := options.Options + if len(optsList) == 0 { + optsList = strings.Split(d.options.mountOptions, ",") + } else { + // If metacopy=on is present in d.options.mountOptions it must be present in the mount + // options otherwise the kernel refuses to follow the metacopy xattr. + if hasMetacopyOption(strings.Split(d.options.mountOptions, ",")) && !hasMetacopyOption(options.Options) { + optsList = append(optsList, "metacopy=on") + } + } + for _, o := range optsList { if o == "ro" { readWrite = false break @@ -1001,10 +1020,8 @@ func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountO } else { opts = fmt.Sprintf("lowerdir=%s:%s", diffDir, strings.Join(absLowers, ":")) } - if len(options.Options) > 0 { - opts = fmt.Sprintf("%s,%s", strings.Join(options.Options, ","), opts) - } else if d.options.mountOptions != "" { - opts = fmt.Sprintf("%s,%s", d.options.mountOptions, opts) + if len(optsList) > 0 { + opts = fmt.Sprintf("%s,%s", strings.Join(optsList, ","), opts) } mountData := label.FormatMountLabel(opts, options.MountLabel) mountFunc := unix.Mount diff --git a/vendor/modules.txt b/vendor/modules.txt index 0b8be9734..ffda75dff 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -173,7 +173,7 @@ github.com/containers/psgo/internal/dev github.com/containers/psgo/internal/host github.com/containers/psgo/internal/proc github.com/containers/psgo/internal/process -# github.com/containers/storage v1.24.5 +# github.com/containers/storage v1.24.6 github.com/containers/storage github.com/containers/storage/drivers github.com/containers/storage/drivers/aufs |