Add reliable RemoveAll to handle racy situations (#6227)

This commit is contained in:
Harshavardhana
2018-08-05 21:15:28 -07:00
committed by Nitish Tiwari
parent 13fbb96736
commit 2dede2fdc2
4 changed files with 53 additions and 6 deletions

View File

@@ -80,10 +80,10 @@ func formatXLCleanupTmpLocalEndpoints(endpoints EndpointList) error {
}
return err
}
if err := os.RemoveAll(pathJoin(endpoint.Path, minioMetaTmpBucket)); err != nil {
if err := removeAll(pathJoin(endpoint.Path, minioMetaTmpBucket)); err != nil {
return err
}
if err := os.MkdirAll(pathJoin(endpoint.Path, minioMetaTmpBucket), 0777); err != nil {
if err := mkdirAll(pathJoin(endpoint.Path, minioMetaTmpBucket), 0777); err != nil {
return err
}
}