From a37552bd5857fe43644ef37f03e33e1eeac7564f Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Fri, 10 Jun 2016 00:24:04 +1000 Subject: [PATCH] pkg: archive: only ignore ENOTSUP when xattr fails There might be other (valid) reasons for setxattr(2) to fail, so only ignore it when it's a not supported error (ENOTSUP). Otherwise, bail. Signed-off-by: Aleksa Sarai Upstream-commit: e6d856df43ac2877ebbcff26e9f3ee755f52bce9 Component: engine --- components/engine/pkg/archive/archive.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/engine/pkg/archive/archive.go b/components/engine/pkg/archive/archive.go index 1603a23026..5ae8ef5592 100644 --- a/components/engine/pkg/archive/archive.go +++ b/components/engine/pkg/archive/archive.go @@ -428,8 +428,15 @@ func createTarFile(path, extractDir string, hdr *tar.Header, reader io.Reader, L var errors []string for key, value := range hdr.Xattrs { if err := system.Lsetxattr(path, key, []byte(value), 0); err != nil { - // We ignore errors here because not all graphdrivers support xattrs. - errors = append(errors, err.Error()) + if err == syscall.ENOTSUP { + // We ignore errors here because not all graphdrivers support + // xattrs *cough* old versions of AUFS *cough*. However only + // ENOTSUP should be emitted in that case, otherwise we still + // bail. + errors = append(errors, err.Error()) + continue + } + return err } }