From fb8de129e7a9f666fa4a1633f156415e6a92c6bb Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Mon, 15 May 2023 16:34:39 +0545 Subject: [PATCH] update reva vendor files --- .../handlers/apps/sharing/shares/spaces.go | 5 +++-- .../cs3org/reva/v2/pkg/storage/cache/cache.go | 3 --- .../storage/utils/decomposedfs/node/node.go | 12 +++++++++-- .../storage/utils/decomposedfs/node/xattrs.go | 20 ++++++++++++++++--- .../storage/utils/decomposedfs/tree/tree.go | 2 +- vendor/modules.txt | 2 +- 6 files changed, 32 insertions(+), 12 deletions(-) diff --git a/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/spaces.go b/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/spaces.go index fbdf6a1555..20c4bbb43f 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/spaces.go +++ b/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/spaces.go @@ -61,8 +61,9 @@ func (h *Handler) getGrantee(ctx context.Context, name string) (provider.Grantee log.Debug().Str("name", name).Msg("no user found") groupRes, err := client.GetGroupByClaim(ctx, &groupv1beta1.GetGroupByClaimRequest{ - Claim: "group_name", - Value: name, + Claim: "group_name", + Value: name, + SkipFetchingMembers: true, }) if err == nil && groupRes.Status.Code == rpc.Code_CODE_OK { return provider.Grantee{ diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/cache/cache.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/cache/cache.go index cf6a7a12fe..4f40bf016a 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/cache/cache.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/cache/cache.go @@ -211,9 +211,6 @@ func (cache cacheStore) List(opts ...microstore.ListOption) ([]string, error) { if err != nil { return nil, err } - for i, key := range keys { - keys[i] = strings.TrimPrefix(key, cache.table) - } return keys, nil } diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node/node.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node/node.go index bd3726e7bc..25a8a8e4ab 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node/node.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node/node.go @@ -405,8 +405,8 @@ func (n *Node) Child(ctx context.Context, name string) (*Node, error) { return c, nil } -// Parent returns the parent node -func (n *Node) Parent() (p *Node, err error) { +// ParentWithReader returns the parent node +func (n *Node) ParentWithReader(r io.Reader) (p *Node, err error) { if n.ParentID == "" { return nil, fmt.Errorf("decomposedfs: root has no parent") } @@ -417,6 +417,9 @@ func (n *Node) Parent() (p *Node, err error) { SpaceRoot: n.SpaceRoot, } + // fill metadata cache using the reader + _, _ = p.XattrsWithReader(r) + // lookup name and parent id in extended attributes p.ParentID, _ = p.XattrString(prefixes.ParentidAttr) p.Name, _ = p.XattrString(prefixes.NameAttr) @@ -428,6 +431,11 @@ func (n *Node) Parent() (p *Node, err error) { return } +// Parent returns the parent node +func (n *Node) Parent() (p *Node, err error) { + return n.ParentWithReader(nil) +} + // Owner returns the space owner func (n *Node) Owner() *userpb.UserId { return n.SpaceRoot.owner diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node/xattrs.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node/xattrs.go index 506d3d047a..8456566318 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node/xattrs.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node/xattrs.go @@ -19,6 +19,7 @@ package node import ( + "io" "strconv" "github.com/pkg/xattr" @@ -84,21 +85,34 @@ func (n *Node) RemoveXattr(key string) error { return n.lu.MetadataBackend().Remove(n.InternalPath(), key) } -// Xattrs returns the extended attributes of the node. If the attributes have already +// XattrsWithReader returns the extended attributes of the node. If the attributes have already // been cached they are not read from disk again. -func (n *Node) Xattrs() (Attributes, error) { +func (n *Node) XattrsWithReader(r io.Reader) (Attributes, error) { if n.xattrsCache != nil { return n.xattrsCache, nil } - attrs, err := n.lu.MetadataBackend().All(n.InternalPath()) + var attrs Attributes + var err error + if r != nil { + attrs, err = n.lu.MetadataBackend().AllWithLockedSource(n.InternalPath(), r) + } else { + attrs, err = n.lu.MetadataBackend().All(n.InternalPath()) + } if err != nil { return nil, err } + n.xattrsCache = attrs return n.xattrsCache, nil } +// Xattrs returns the extended attributes of the node. If the attributes have already +// been cached they are not read from disk again. +func (n *Node) Xattrs() (Attributes, error) { + return n.XattrsWithReader(nil) +} + // Xattr returns an extended attribute of the node. If the attributes have already // been cached it is not read from disk again. func (n *Node) Xattr(key string) ([]byte, error) { diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/tree/tree.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/tree/tree.go index d121252945..90fc96b051 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/tree/tree.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/tree/tree.go @@ -731,7 +731,7 @@ func (t *Tree) Propagate(ctx context.Context, n *node.Node, sizeDiff int64) (err } }() - if n, err = n.Parent(); err != nil { + if n, err = n.ParentWithReader(f); err != nil { return err } diff --git a/vendor/modules.txt b/vendor/modules.txt index 74e472e6a6..6bbfffb619 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -349,7 +349,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1 github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1 github.com/cs3org/go-cs3apis/cs3/tx/v1beta1 github.com/cs3org/go-cs3apis/cs3/types/v1beta1 -# github.com/cs3org/reva/v2 v2.13.3-0.20230510083816-98d8707dea33 +# github.com/cs3org/reva/v2 v2.13.3-0.20230515075524-e00c55c0a4d3 ## explicit; go 1.19 github.com/cs3org/reva/v2/cmd/revad/internal/grace github.com/cs3org/reva/v2/cmd/revad/runtime