Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
Ignore xattr ENOTSUP errors on copy (fixes moby#38155)
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitris Mandalidis <[email protected]>
(cherry picked from commit d0192ae)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
dmandalidis authored and thaJeztah committed Feb 9, 2019
1 parent a79fabb commit c51d247
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 32 deletions.
15 changes: 14 additions & 1 deletion container/container_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
"syscall"

"github.com/containerd/continuity/fs"
"github.com/docker/docker/api/types"
Expand Down Expand Up @@ -388,6 +389,18 @@ func (container *Container) DetachAndUnmount(volumeEventLog func(name, action st
return container.UnmountVolumes(volumeEventLog)
}

// ignoreUnsupportedXAttrs ignores errors when extended attributes
// are not supported
func ignoreUnsupportedXAttrs() fs.CopyDirOpt {
xeh := func(dst, src, xattrKey string, err error) error {
if errors.Cause(err) != syscall.ENOTSUP {
return err
}
return nil
}
return fs.WithXAttrErrorHandler(xeh)
}

// copyExistingContents copies from the source to the destination and
// ensures the ownership is appropriately set.
func copyExistingContents(source, destination string) error {
Expand All @@ -399,7 +412,7 @@ func copyExistingContents(source, destination string) error {
// destination is not empty, do not copy
return nil
}
return fs.CopyDir(destination, source)
return fs.CopyDir(destination, source, ignoreUnsupportedXAttrs())
}

// TmpfsMounts returns the list of tmpfs mounts
Expand Down
2 changes: 1 addition & 1 deletion vendor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ google.golang.org/genproto 694d95ba50e67b2e363f3483057db5d4910c18f9
# containerd
github.com/containerd/containerd 9754871865f7fe2f4e74d43e2fc7ccd237edcbce # v1.2.2
github.com/containerd/fifo 3d5202aec260678c48179c56f40e6f38a095738c
github.com/containerd/continuity bd77b46c8352f74eb12c85bdc01f4b90f69d66b4
github.com/containerd/continuity 004b46473808b3e7a4a3049c20e4376c91eb966d
github.com/containerd/cgroups 5e610833b72089b37d0e615de9a92dfc043757c2
github.com/containerd/console c12b1e7919c14469339a5d38f2f8ed9b64a9de23
github.com/containerd/cri 0d5cabd006cb5319dc965046067b8432d9fa5ef8 # release/1.2 branch
Expand Down
19 changes: 4 additions & 15 deletions vendor/github.com/containerd/continuity/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions vendor/github.com/containerd/continuity/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 40 additions & 5 deletions vendor/github.com/containerd/continuity/fs/copy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 32 additions & 5 deletions vendor/github.com/containerd/continuity/fs/copy_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 20 additions & 4 deletions vendor/github.com/containerd/continuity/fs/copy_unix.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c51d247

Please sign in to comment.