Skip to content

Commit

Permalink
Merge pull request #45465 from corhere/backport-23.0/copy-xattr-notsupp
Browse files Browse the repository at this point in the history
[23.0 backport] d/graphdriver/copy: support src fs w/o xattr support
  • Loading branch information
thaJeztah committed May 4, 2023
2 parents c5197fe + 94fcd2d commit 24fd7c5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions daemon/graphdriver/copy/copy.go
Expand Up @@ -5,6 +5,7 @@ package copy // import "github.com/docker/docker/daemon/graphdriver/copy"

import (
"container/list"
"errors"
"fmt"
"io"
"os"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 24fd7c5

Please sign in to comment.