Skip to content

Commit

Permalink
Do not choke on emtpy space root metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck committed Jun 28, 2023
1 parent f2c39e4 commit 5cc5706
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/storage/utils/decomposedfs/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5cc5706

Please sign in to comment.