@ -279,18 +279,15 @@ func (xl xlObjects) commitXLMetadata(srcPrefix, dstPrefix string) error {
// Rename `xl.json` in a routine.
// Rename `xl.json` in a routine.
go func ( index int , disk StorageAPI ) {
go func ( index int , disk StorageAPI ) {
defer wg . Done ( )
defer wg . Done ( )
// Delete any dangling directories.
defer disk . DeleteFile ( minioMetaBucket , srcPrefix )
// Renames `xl.json` from source prefix to destination prefix.
// Renames `xl.json` from source prefix to destination prefix.
rErr := disk . RenameFile ( minioMetaBucket , srcJSONFile , minioMetaBucket , dstJSONFile )
rErr := disk . RenameFile ( minioMetaBucket , srcJSONFile , minioMetaBucket , dstJSONFile )
if rErr != nil {
if rErr != nil {
mErrs [ index ] = rErr
mErrs [ index ] = rErr
return
return
}
}
// Delete any dangling directories.
dErr := disk . DeleteFile ( minioMetaBucket , srcPrefix )
if dErr != nil {
mErrs [ index ] = dErr
return
}
mErrs [ index ] = nil
mErrs [ index ] = nil
} ( index , disk )
} ( index , disk )
}
}