diff --git a/cmd/xl-v1-multipart.go b/cmd/xl-v1-multipart.go index 7de8b8d56..0db7e3567 100644 --- a/cmd/xl-v1-multipart.go +++ b/cmd/xl-v1-multipart.go @@ -353,7 +353,7 @@ func (xl xlObjects) PutObjectPart(ctx context.Context, bucket, object, uploadID defer xl.bp.Put(buffer) case size < blockSizeV1: // No need to allocate fully blockSizeV1 buffer if the incoming data is smaller. - buffer = make([]byte, size, 2*size) + buffer = make([]byte, size, 2*size+int64(erasure.parityBlocks+erasure.dataBlocks-1)) } if len(buffer) > int(xlMeta.Erasure.BlockSize) { diff --git a/cmd/xl-v1-object.go b/cmd/xl-v1-object.go index 13dd50a2c..6daa6923a 100644 --- a/cmd/xl-v1-object.go +++ b/cmd/xl-v1-object.go @@ -559,7 +559,7 @@ func (xl xlObjects) putObject(ctx context.Context, bucket string, object string, defer xl.bp.Put(buffer) case size < blockSizeV1: // No need to allocate fully blockSizeV1 buffer if the incoming data is smaller. - buffer = make([]byte, size, 2*size) + buffer = make([]byte, size, 2*size+int64(erasure.parityBlocks+erasure.dataBlocks-1)) } if len(buffer) > int(xlMeta.Erasure.BlockSize) {