From d32f3288f8eaf71ddc10fffcdd7721583cf701ea Mon Sep 17 00:00:00 2001 From: Bala FA Date: Tue, 7 Jun 2016 23:32:12 +0530 Subject: [PATCH] XL: return false only if given prefix doesn't exist in all disks (#1877) Previously xl.isObject() returns false if one of the disk doesn't have the object. Its possible that object may be present in another disk. This patch fixes the issue by returning false only if given prefix doesn't exist in all disks. Fixes #1855 --- xl-v1-common.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xl-v1-common.go b/xl-v1-common.go index 92314d4c9..972b35e76 100644 --- a/xl-v1-common.go +++ b/xl-v1-common.go @@ -61,16 +61,19 @@ func (xl xlObjects) isObject(bucket, prefix string) bool { if disk == nil { continue } + // Check if 'prefix' is an object in this 'disk', else continue the check with next disk _, err := disk.StatFile(bucket, path.Join(prefix, xlMetaJSONFile)) if err != nil { - if err == errDiskNotFound { + if err == errFileNotFound || err == errDiskNotFound { continue } - return false + // TODO: log the error + } else { + return true } - break } - return true + + return false } // statPart - returns fileInfo structure for a successful stat on part file.