diff --git a/pkg/storage/utils/decomposedfs/node/node.go b/pkg/storage/utils/decomposedfs/node/node.go index 795ce65c0e..7645ea54c6 100644 --- a/pkg/storage/utils/decomposedfs/node/node.go +++ b/pkg/storage/utils/decomposedfs/node/node.go @@ -37,6 +37,12 @@ import ( userpb "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" types "github.com/cs3org/go-cs3apis/cs3/types/v1beta1" + "github.com/google/uuid" + "github.com/pkg/errors" + "github.com/rogpeppe/go-internal/lockedfile" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/trace" + "github.com/cs3org/reva/v2/internal/grpc/services/storageprovider" "github.com/cs3org/reva/v2/pkg/appctx" ctxpkg "github.com/cs3org/reva/v2/pkg/ctx" @@ -48,11 +54,6 @@ import ( "github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/metadata/prefixes" "github.com/cs3org/reva/v2/pkg/storage/utils/grants" "github.com/cs3org/reva/v2/pkg/utils" - "github.com/google/uuid" - "github.com/pkg/errors" - "github.com/rogpeppe/go-internal/lockedfile" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/trace" ) var tracer trace.Tracer @@ -1261,8 +1262,7 @@ func (n *Node) ProcessingID(ctx context.Context) (string, error) { // IsSpaceRoot checks if the node is a space root func (n *Node) IsSpaceRoot(ctx context.Context) bool { - _, err := n.Xattr(ctx, prefixes.SpaceNameAttr) - return err == nil + return n.ID == n.SpaceID } // SetScanData sets the virus scan info to the node diff --git a/pkg/storage/utils/decomposedfs/tree/propagator/async.go b/pkg/storage/utils/decomposedfs/tree/propagator/async.go index 61bf9899e2..65de838742 100644 --- a/pkg/storage/utils/decomposedfs/tree/propagator/async.go +++ b/pkg/storage/utils/decomposedfs/tree/propagator/async.go @@ -26,6 +26,13 @@ import ( "strings" "time" + "github.com/google/renameio/v2" + "github.com/google/uuid" + "github.com/pkg/errors" + "github.com/rogpeppe/go-internal/lockedfile" + "github.com/rs/zerolog" + "github.com/shamaton/msgpack/v2" + "github.com/cs3org/reva/v2/pkg/appctx" "github.com/cs3org/reva/v2/pkg/logger" "github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/lookup" @@ -33,12 +40,6 @@ import ( "github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/metadata/prefixes" "github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node" "github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/options" - "github.com/google/renameio/v2" - "github.com/google/uuid" - "github.com/pkg/errors" - "github.com/rogpeppe/go-internal/lockedfile" - "github.com/rs/zerolog" - "github.com/shamaton/msgpack/v2" ) var _propagationGracePeriod = 3 * time.Minute @@ -414,7 +415,7 @@ func (p AsyncPropagator) propagate(ctx context.Context, spaceID, nodeID string, log.Info().Msg("Propagation done. cleaning up") cleanup() - if !n.IsSpaceRoot(ctx) { // This does not seem robust as it checks the space name property + if !n.IsSpaceRoot(ctx) { p.queuePropagation(ctx, n.SpaceID, n.ParentID, pc, log) }