瀏覽代碼

Merge pull request #45463 from corhere/copy-xattr-notsupp

d/graphdriver/copy: support src fs w/o xattr support
Brian Goff 2 年之前
父節點
當前提交
698fa85f38
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      daemon/graphdriver/copy/copy.go

+ 6 - 0
daemon/graphdriver/copy/copy.go

@@ -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 {