From 1ebf9c38851ef1d488e264ce4928e3fec2176d43 Mon Sep 17 00:00:00 2001 From: utam0k Date: Tue, 31 May 2022 06:17:29 +0000 Subject: [PATCH 1/2] content-server: ignore the error of setattribute. --- components/content-service/pkg/archive/tar.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/components/content-service/pkg/archive/tar.go b/components/content-service/pkg/archive/tar.go index f078cf16a7b60a..22abee7d236e57 100644 --- a/components/content-service/pkg/archive/tar.go +++ b/components/content-service/pkg/archive/tar.go @@ -198,10 +198,7 @@ func remapFile(name string, uid, gid int, xattrs map[string]string) error { if err == syscall.ENOTSUP || err == syscall.EPERM { continue } - - log.WithField("name", key).WithField("value", value).WithField("file", name).WithError(err).Error("restoring extended attributes") - - return err + log.WithField("name", key).WithField("value", value).WithField("file", name).WithError(err).Warn("restoring extended attributes") } } From 2353a66341550f01efb44aa1638093cbf0ae00a8 Mon Sep 17 00:00:00 2001 From: utam0k Date: Tue, 31 May 2022 06:27:13 +0000 Subject: [PATCH 2/2] content-service: ignore the error of user.overlay.(impure|origin) attributes --- components/content-service/pkg/archive/tar.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/content-service/pkg/archive/tar.go b/components/content-service/pkg/archive/tar.go index 22abee7d236e57..e52a611fdea4a1 100644 --- a/components/content-service/pkg/archive/tar.go +++ b/components/content-service/pkg/archive/tar.go @@ -194,10 +194,19 @@ func remapFile(name string, uid, gid int, xattrs map[string]string) error { continue } + if strings.HasPrefix(key, "user.") { + // This is a marker to match inodes, such as when an upper layer copies a lower layer file in overlayfs. + // However, when restoring a content, the container in the workspace is not always running, so there is no problem ignoring the failure. + if strings.HasSuffix(key, ".overlay.impure") || strings.HasSuffix(key, ".overlay.origin") { + continue + } + } + if err := unix.Lsetxattr(name, key, []byte(value), 0); err != nil { if err == syscall.ENOTSUP || err == syscall.EPERM { continue } + log.WithField("name", key).WithField("value", value).WithField("file", name).WithError(err).Warn("restoring extended attributes") } }