From 466a2e01f1c1bdb26ef1767045fc1b2979e74014 Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Fri, 17 Jun 2016 12:47:15 +0530 Subject: [PATCH] XL/Erasure: Blocksize for object-part should be derived from what was decided during xl.NewMultipartUpload which creates xl.json. (#1920) fixes #1919 --- erasure-createfile.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erasure-createfile.go b/erasure-createfile.go index 8dc70573f..7b1f28d6e 100644 --- a/erasure-createfile.go +++ b/erasure-createfile.go @@ -29,13 +29,13 @@ import ( // all the disks, writes also calculate individual block's checksum // for future bit-rot protection. func erasureCreateFile(disks []StorageAPI, volume string, path string, partName string, data io.Reader, eInfos []erasureInfo, writeQuorum int) (newEInfos []erasureInfo, size int64, err error) { - // Allocated blockSized buffer for reading. - buf := make([]byte, blockSizeV1) - hashWriters := newHashWriters(len(disks)) - // Just pick one eInfo. eInfo := pickValidErasureInfo(eInfos) + // Allocated blockSized buffer for reading. + buf := make([]byte, eInfo.BlockSize) + hashWriters := newHashWriters(len(disks)) + // Read until io.EOF, erasure codes data and writes to all disks. for { var n int