Protect multipart directory from removing when it is empty (#3315)

This commit is contained in:
Anis Elleuch
2016-11-22 22:15:06 +01:00
committed by Harshavardhana
parent dd93f808c8
commit 339c9019b9
11 changed files with 124 additions and 115 deletions

View File

@@ -178,7 +178,7 @@ func (b *backgroundAppend) appendParts(disk StorageAPI, bucket, object, uploadID
// Appends the "part" to the append-file inside "tmp/" that finally gets moved to the actual location
// upon complete-multipart-upload.
func appendPart(disk StorageAPI, bucket, object, uploadID string, part objectPartInfo) error {
partPath := pathJoin(mpartMetaPrefix, bucket, object, uploadID, part.Name)
partPath := pathJoin(bucket, object, uploadID, part.Name)
appendFilePath := getFSAppendDataPath(uploadID)
offset := int64(0)
@@ -190,7 +190,7 @@ func appendPart(disk StorageAPI, bucket, object, uploadID string, part objectPar
curLeft = totalLeft
}
var n int64
n, err := disk.ReadFile(minioMetaBucket, partPath, offset, buf[:curLeft])
n, err := disk.ReadFile(minioMetaMultipartBucket, partPath, offset, buf[:curLeft])
if err != nil {
// Check for EOF/ErrUnexpectedEOF not needed as it should never happen as we know
// the exact size of the file and hence know the size of buf[]