From 285a94d2c0192578e8b777e0832a6062884f47f4 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Thu, 30 Jun 2016 16:37:51 -0700 Subject: [PATCH] Ignored errors in cleanup in commitXLMetadata (#2044) Deletion of tmp files where xl metadata was saved before the commit operation doesn't change the error returned to the caller. So, it is to be ignored. --- xl-v1-multipart-common.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/xl-v1-multipart-common.go b/xl-v1-multipart-common.go index e36b34a84..aefe18264 100644 --- a/xl-v1-multipart-common.go +++ b/xl-v1-multipart-common.go @@ -279,18 +279,15 @@ func (xl xlObjects) commitXLMetadata(srcPrefix, dstPrefix string) error { // Rename `xl.json` in a routine. go func(index int, disk StorageAPI) { defer wg.Done() + // Delete any dangling directories. + defer disk.DeleteFile(minioMetaBucket, srcPrefix) + // Renames `xl.json` from source prefix to destination prefix. rErr := disk.RenameFile(minioMetaBucket, srcJSONFile, minioMetaBucket, dstJSONFile) if rErr != nil { mErrs[index] = rErr return } - // Delete any dangling directories. - dErr := disk.DeleteFile(minioMetaBucket, srcPrefix) - if dErr != nil { - mErrs[index] = dErr - return - } mErrs[index] = nil }(index, disk) }