xl/fs: Make i/o operations atomic. (#1496)

This commit is contained in:
Harshavardhana
2016-05-05 20:28:22 -07:00
committed by Anand Babu (AB) Periasamy
parent 17868ccd7f
commit 5133ea50bd
7 changed files with 95 additions and 141 deletions

View File

@@ -174,6 +174,9 @@ func putObjectCommon(storage StorageAPI, bucket string, object string, size int6
}
err = fileWriter.Close()
if err != nil {
if clErr := safeCloseAndRemove(fileWriter); clErr != nil {
return "", clErr
}
return "", err
}
err = storage.RenameFile(minioMetaBucket, tempObj, bucket, object)