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
This commit is contained in:
Klaus Post 2022-05-23 06:28:46 -07:00 committed by GitHub
parent 8859c92f80
commit 90a52a29c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.