From d28bf71f2509631c8679859107a18f500e3b4a83 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 7 Feb 2024 13:20:07 -0800 Subject: [PATCH] listing must return WalkDir() errors first (#19006) --- cmd/metacache-server-pool.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cmd/metacache-server-pool.go b/cmd/metacache-server-pool.go index 186239c9c..e2b35aa2c 100644 --- a/cmd/metacache-server-pool.go +++ b/cmd/metacache-server-pool.go @@ -305,6 +305,15 @@ func (z *erasureServerPools) listMerged(ctx context.Context, o listPathOptions, cancelList() wg.Wait() + + // we should return 'errs' from per disk + if isAllNotFound(errs) { + if isAllVolumeNotFound(errs) { + return errVolumeNotFound + } + return nil + } + if err != nil { return err } @@ -313,13 +322,6 @@ func (z *erasureServerPools) listMerged(ctx context.Context, o listPathOptions, return ctx.Err() } - if isAllNotFound(errs) { - if isAllVolumeNotFound(errs) { - return errVolumeNotFound - } - return nil - } - for _, err := range errs { if errors.Is(err, io.EOF) { continue