From ca6f7955043d5e71f79b21578450f25f48a0e392 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Sat, 6 Oct 2018 01:09:20 +0100 Subject: [PATCH] xl: check for correct err variable when prepareFile fails in PutObjectPart (#6573) in xl.PutObjectPart call, prepareFile detected an error when the storage is exhausted but we were returning the wrong error. With this commit, users can see the correct error message when their disks become full. --- cmd/xl-v1-multipart.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/xl-v1-multipart.go b/cmd/xl-v1-multipart.go index 6f71fa1b7..63de4a546 100644 --- a/cmd/xl-v1-multipart.go +++ b/cmd/xl-v1-multipart.go @@ -343,7 +343,7 @@ func (xl xlObjects) PutObjectPart(ctx context.Context, bucket, object, uploadID // Delete the temporary object part. If PutObjectPart succeeds there would be nothing to delete. defer xl.deleteObject(ctx, minioMetaTmpBucket, tmpPart, writeQuorum, false) if data.Size() > 0 || data.Size() == -1 { - if pErr := xl.prepareFile(ctx, minioMetaTmpBucket, tmpPartPath, data.Size(), onlineDisks, xlMeta.Erasure.BlockSize, xlMeta.Erasure.DataBlocks, writeQuorum); err != nil { + if pErr := xl.prepareFile(ctx, minioMetaTmpBucket, tmpPartPath, data.Size(), onlineDisks, xlMeta.Erasure.BlockSize, xlMeta.Erasure.DataBlocks, writeQuorum); pErr != nil { return pi, toObjectErr(pErr, bucket, object) }