From 6654b66114521abc0031bbb0e76df43bcba6f137 Mon Sep 17 00:00:00 2001 From: Lesmiscore Date: Mon, 10 Oct 2022 12:18:54 +0900 Subject: [PATCH] union: propagate SlowHash feature --- backend/union/union.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/union/union.go b/backend/union/union.go index 7e10f06b8..fcfe4ac95 100644 --- a/backend/union/union.go +++ b/backend/union/union.go @@ -894,18 +894,22 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e WriteMetadata: true, UserMetadata: true, }).Fill(ctx, f) - canMove := true + canMove, slowHash := true, false for _, f := range upstreams { features = features.Mask(ctx, f) // Mask all upstream fs if !operations.CanServerSideMove(f) { canMove = false } + slowHash = slowHash || f.Features().SlowHash } // We can move if all remotes support Move or Copy if canMove { features.Move = f.Move } + // If any of upstreams are SlowHash, propagate it + features.SlowHash = slowHash + // Enable ListR when upstreams either support ListR or is local // But not when all upstreams are local if features.ListR == nil {