Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

content-service: ignore the error of user.overlay.(impure|origin) attributes #10372

Merged
merged 2 commits into from
Jun 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions components/content-service/pkg/archive/tar.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,20 @@ 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).Error("restoring extended attributes")

return err
log.WithField("name", key).WithField("value", value).WithField("file", name).WithError(err).Warn("restoring extended attributes")
}
}

Expand Down