Skip to content

Commit

Permalink
content-service: ignore the error of user.overlay.(impure|origin) att…
Browse files Browse the repository at this point in the history
…ributes
  • Loading branch information
utam0k committed May 31, 2022
1 parent 1ebf9c3 commit 2353a66
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions components/content-service/pkg/archive/tar.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Expand Down

0 comments on commit 2353a66

Please sign in to comment.