mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
xl: Respect min. space by checking PrepareFile err (#3867)
It was possible to upload a big file which overcomes the minimal disk space limit in XL, PrepareFile was actually checking for disk space but we weren't checking its returned error. This patch fixes this behavior.
This commit is contained in:
committed by
Harshavardhana
parent
79e0b9e69a
commit
a2eae54d11
@@ -648,11 +648,9 @@ func (xl xlObjects) PutObjectPart(bucket, object, uploadID string, partID int, s
|
||||
defer xl.deleteObject(minioMetaTmpBucket, tmpPart)
|
||||
|
||||
if size > 0 {
|
||||
for _, disk := range onlineDisks {
|
||||
if disk != nil {
|
||||
actualSize := xl.sizeOnDisk(size, xlMeta.Erasure.BlockSize, xlMeta.Erasure.DataBlocks)
|
||||
disk.PrepareFile(minioMetaTmpBucket, tmpPartPath, actualSize)
|
||||
}
|
||||
if pErr := xl.prepareFile(minioMetaTmpBucket, tmpPartPath, size, onlineDisks, xlMeta.Erasure.BlockSize, xlMeta.Erasure.DataBlocks); err != nil {
|
||||
return PartInfo{}, toObjectErr(pErr, bucket, object)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user