From b05c0fd3fcbecc051122adcbd2d616b55bd0f7aa Mon Sep 17 00:00:00 2001 From: Xiaodong Ye Date: Tue, 24 Dec 2019 15:49:11 +0800 Subject: [PATCH] xattr lost when copying directory Signed-off-by: Xiaodong Ye --- fs/copy.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/copy.go b/fs/copy.go index 97053d7e..818bba2c 100644 --- a/fs/copy.go +++ b/fs/copy.go @@ -104,6 +104,10 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er return errors.Wrapf(err, "failed to copy file info for %s", dst) } + if err := copyXAttrs(dst, src, o.xeh); err != nil { + return errors.Wrap(err, "failed to copy xattrs") + } + for _, fi := range fis { source := filepath.Join(src, fi.Name()) target := filepath.Join(dst, fi.Name())