bump reva 2.29.2 (#681)

This commit is contained in:
Viktor Scharf
2025-04-17 09:17:11 +02:00
committed by GitHub
parent a3a5a5a047
commit c8df6a27b6
5 changed files with 20 additions and 8 deletions
@@ -392,11 +392,14 @@ func (lu *Lookup) GenerateSpaceID(spaceType string, owner *user.User) (string, e
case _spaceTypeProject:
return uuid.New().String(), nil
case _spaceTypePersonal:
path := templates.WithUser(owner, lu.Options.PersonalSpacePathTemplate)
relPath := templates.WithUser(owner, lu.Options.PersonalSpacePathTemplate)
path := filepath.Join(lu.Options.Root, relPath)
spaceID, _, err := lu.IDsForPath(context.TODO(), filepath.Join(lu.Options.Root, path))
// do we already know about this space?
spaceID, _, err := lu.IDsForPath(context.TODO(), path)
if err != nil {
_, err := os.Stat(filepath.Join(lu.Options.Root, path))
// check if the space exists on disk incl. attributes
spaceID, _, _, err := lu.metadataBackend.IdentifyPath(context.TODO(), path)
if err != nil {
if metadata.IsNotExist(err) || metadata.IsAttrUnset(err) {
return uuid.New().String(), nil
@@ -404,6 +407,10 @@ func (lu *Lookup) GenerateSpaceID(spaceType string, owner *user.User) (string, e
return "", err
}
}
if len(spaceID) == 0 {
return "", errtypes.InternalError("encountered empty space id on disk")
}
return spaceID, nil
}
return spaceID, nil
default:
@@ -46,7 +46,12 @@ func (HybridBackend) Name() string { return "hybrid" }
// IdentifyPath returns the space id, node id and mtime of a file
func (b HybridBackend) IdentifyPath(_ context.Context, path string) (string, string, time.Time, error) {
spaceID, _ := xattr.Get(path, prefixes.SpaceIDAttr)
spaceID, err := xattr.Get(path, prefixes.SpaceIDAttr)
if err != nil {
if IsNotExist(err) {
return "", "", time.Time{}, err
}
}
id, _ := xattr.Get(path, prefixes.IDAttr)
mtimeAttr, _ := xattr.Get(path, prefixes.MTimeAttr)