XL/GetObject: If the offset does not fall in the first "dataBlock" it gives incorrect data. (#1583)

Fixes #1582
This commit is contained in:
Krishna Srinivas 2016-05-11 00:08:49 +05:30 committed by Harshavardhana
parent e99cb05516
commit b044336329

View file

@ -179,6 +179,7 @@ func (xl XL) ReadFile(volume, path string, startOffset int64) (io.ReadCloser, er
startOffset = startOffset - int64(len(dataBlocks))
// Start offset is greater than or equal to zero, skip the dataBlocks.
if startOffset >= 0 {
totalLeft = totalLeft - metadata.Erasure.BlockSize
continue
}
// Now get back the remaining offset if startOffset is negative.