Avoid shadowing ignored errors listAllBuckets() (#5524)

It can happen such that one of the disks that was down would
return 'errDiskNotFound' but the err is preserved due to
loop shadowing which leads to issues when healing the bucket.
This commit is contained in:
Harshavardhana 2018-02-13 17:03:50 -08:00 committed by kannappanr
parent 4ca10479b5
commit 994fe53669
1 changed files with 2 additions and 2 deletions

View File

@ -300,7 +300,7 @@ func listAllBuckets(storageDisks []StorageAPI) (buckets map[string]VolInfo,
if errors.IsErrIgnored(err, bucketMetadataOpIgnoredErrs...) {
continue
}
break
return nil, nil, err
}
for _, volInfo := range volsInfo {
// StorageAPI can send volume names which are
@ -316,7 +316,7 @@ func listAllBuckets(storageDisks []StorageAPI) (buckets map[string]VolInfo,
buckets[volInfo.Name] = volInfo
}
}
return buckets, bucketsOcc, err
return buckets, bucketsOcc, nil
}
// ListBucketsHeal - Find all buckets that need to be healed