From 90a52a29c5c8df24a3edfb0a019e3cbaadee2e43 Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Mon, 23 May 2022 06:28:46 -0700 Subject: [PATCH] Fix WalkDir fallback hot loop (#14961) Fix fallback hot loop fd was never refreshed, leading to an infinite hot loop if a disk failed and the fallback disk fails as well. Fix & simplify retry loop. Fixes #14960 --- cmd/metacache-set.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/metacache-set.go b/cmd/metacache-set.go index 9b5213175..f0c090a43 100644 --- a/cmd/metacache-set.go +++ b/cmd/metacache-set.go @@ -882,7 +882,11 @@ func listPathRaw(ctx context.Context, opts listPathRawOptions) (err error) { } // fallback only when set. - for fd := fallback(werr); fd != nil; { + for { + fd := fallback(werr) + if fd == nil { + break + } // This fallback is only set when // askDisks is less than total // number of disks per set.