Fix a crash due to race between Abort/CompleteMultipart (#6544)

Fixes #6429
This commit is contained in:
Harshavardhana 2018-10-01 09:50:09 -07:00 committed by GitHub
parent aebfceeafb
commit 839a758a36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -621,12 +621,12 @@ func (fs *FSObjects) CompleteMultipartUpload(ctx context.Context, bucket string,
}
if appendFallback {
fsRemoveFile(ctx, file.filePath)
if file != nil {
fsRemoveFile(ctx, file.filePath)
}
for _, part := range parts {
partPath := getPartFile(entries, part.PartNumber, part.ETag)
partPath = pathJoin(uploadIDDir, partPath)
err = mioutil.AppendFile(appendFilePath, partPath)
if err != nil {
if err = mioutil.AppendFile(appendFilePath, pathJoin(uploadIDDir, partPath)); err != nil {
logger.LogIf(ctx, err)
return oi, toObjectErr(err)
}