xl/multipart: Make sure to delete temp renamed object. (#3785)

Existing objects before overwrites are renamed to
temp location in completeMultipart. We make sure
that we delete it even if subsequenty calls fail.

Additionally move verifying of parent dir is a
file earlier to fail the entire operation.

Ref #3784
This commit is contained in:
Harshavardhana
2017-02-21 19:43:44 -08:00
committed by GitHub
parent fe86319c56
commit cc28765025
3 changed files with 39 additions and 26 deletions
+1 -1
View File
@@ -483,7 +483,7 @@ func (api objectAPIHandlers) PutObjectHandler(w http.ResponseWriter, r *http.Req
objInfo, err = objectAPI.PutObject(bucket, object, size, r.Body, metadata, sha256sum)
}
if err != nil {
errorIf(err, "Unable to create an object.")
errorIf(err, "Unable to create an object. %s", r.URL.Path)
writeErrorResponse(w, toAPIErrorCode(err), r.URL)
return
}