diff --git a/object-common-multipart.go b/object-common-multipart.go index f63ced54f..81c9116bd 100644 --- a/object-common-multipart.go +++ b/object-common-multipart.go @@ -39,7 +39,8 @@ const ( func createUploadsJSON(storage StorageAPI, bucket, object, uploadID string) error { // Place holder uploads.json uploadsPath := path.Join(mpartMetaPrefix, bucket, object, uploadsJSONFile) - tmpUploadsPath := path.Join(tmpMetaPrefix, bucket, object, uploadID, uploadsJSONFile) + uploadsJSONSuffix := fmt.Sprintf("%s.%s", uploadID, uploadsJSONFile) + tmpUploadsPath := path.Join(tmpMetaPrefix, bucket, object, uploadsJSONSuffix) w, err := storage.CreateFile(minioMetaBucket, uploadsPath) if err != nil { return err @@ -98,7 +99,8 @@ func newMultipartUploadCommon(storage StorageAPI, bucket string, object string) return "", err } uploadIDPath := path.Join(mpartMetaPrefix, bucket, object, uploadID, incompleteFile) - tempUploadIDPath := path.Join(tmpMetaPrefix, bucket, object, uploadID, incompleteFile) + incompleteSuffix := fmt.Sprintf("%s.%s", uploadID, incompleteFile) + tempUploadIDPath := path.Join(tmpMetaPrefix, bucket, object, incompleteSuffix) if _, err = storage.StatFile(minioMetaBucket, uploadIDPath); err != nil { if err != errFileNotFound { return "", toObjectErr(err, minioMetaBucket, uploadIDPath) diff --git a/xl-objects-multipart.go b/xl-objects-multipart.go index 6da8488d2..608771769 100644 --- a/xl-objects-multipart.go +++ b/xl-objects-multipart.go @@ -183,7 +183,8 @@ func (xl xlObjects) CompleteMultipartUpload(bucket string, object string, upload metadata.ModTime = time.Now().UTC() // Create temporary multipart meta file to write and then rename. - tempMultipartMetaFile := path.Join(tmpMetaPrefix, bucket, object, uploadID, multipartMetaFile) + multipartMetaSuffix := fmt.Sprintf("%s.%s", uploadID, multipartMetaFile) + tempMultipartMetaFile := path.Join(tmpMetaPrefix, bucket, object, multipartMetaSuffix) w, err := xl.storage.CreateFile(minioMetaBucket, tempMultipartMetaFile) if err != nil { return "", toObjectErr(err, bucket, object)