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

Commit

Permalink
Merge pull request #135 from thaJeztah/18.09_backport_xattr_fix
Browse files Browse the repository at this point in the history
[18.09 backport] Ignore xattr ENOTSUP errors on copy (fixes moby#38155)
  • Loading branch information
tiborvass authored Feb 21, 2019
2 parents 6b0ba37 + c51d247 commit db7a8cb
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.

2 changes: 1 addition & 1 deletion vendor/github.com/containerd/continuity/fs/copy_windows.go

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

0 comments on commit db7a8cb

Please sign in to comment.