Merge pull request #45465 from corhere/backport-23.0/copy-xattr-notsupp

[23.0 backport] d/graphdriver/copy: support src fs w/o xattr support
This commit is contained in:
Sebastiaan van Stijn 2023-05-05 01:14:43 +02:00 committed by GitHub
commit 24fd7c5eb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,7 @@ package copy // import "github.com/docker/docker/daemon/graphdriver/copy"
import (
"container/list"
"errors"
"fmt"
"io"
"os"
@ -90,6 +91,11 @@ func legacyCopy(srcFile io.Reader, dstFile io.Writer) error {
func copyXattr(srcPath, dstPath, attr string) error {
data, err := system.Lgetxattr(srcPath, attr)
if err != nil {
if errors.Is(err, syscall.EOPNOTSUPP) {
// Task failed successfully: there is no xattr to copy
// if the source filesystem doesn't support xattrs.
return nil
}
return err
}
if data != nil {