From 5cc5706ed3991801e5525219982e8be120e50f24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Wed, 28 Jun 2023 08:21:56 +0200 Subject: [PATCH] Do not choke on emtpy space root metadata --- pkg/storage/utils/decomposedfs/node/node.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/storage/utils/decomposedfs/node/node.go b/pkg/storage/utils/decomposedfs/node/node.go index 9c52eeeeebd..961980c34ba 100644 --- a/pkg/storage/utils/decomposedfs/node/node.go +++ b/pkg/storage/utils/decomposedfs/node/node.go @@ -223,13 +223,16 @@ func ReadNode(ctx context.Context, lu PathLookup, spaceID, nodeID string, canLis case err != nil: return nil, err } - spaceRoot.Exists = true // lookup name in extended attributes spaceRoot.Name, err = spaceRoot.XattrString(prefixes.NameAttr) - if err != nil { + switch { + case metadata.IsAttrUnset(err): + return spaceRoot, nil // empty metadata. create from scratch + case err != nil: return nil, err } + spaceRoot.Exists = true } // TODO ReadNode should not check permissions