From 994fe53669df10cf73550cd851a71866590c1b14 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 13 Feb 2018 17:03:50 -0800 Subject: [PATCH] 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. --- cmd/xl-v1-healing.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/xl-v1-healing.go b/cmd/xl-v1-healing.go index 3ef1dbbc7..38af77ce3 100644 --- a/cmd/xl-v1-healing.go +++ b/cmd/xl-v1-healing.go @@ -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