mirror of
https://github.com/minio/minio.git
synced 2025-11-12 14:51:36 -05:00
erasureReadFile and erasureCreateFile testcases. (#2229)
* unit-tests: Unit tests for erasureCreateFile and erasureReadFile. * appendFile() should return errXLWriteQuorum. * TestErasureReadFileOffsetLength() tests erasureReadFile() for different offset and lengths. * Fix for the failure seen in the erasure read unit test case. Issue #2227 * Move common erasure setup code to newErasureTestSetup() * Review fixes. Add few more test cases for erasureReadFile.
This commit is contained in:
committed by
Harshavardhana
parent
1f706e067d
commit
897d78d113
@@ -262,14 +262,17 @@ func erasureReadFile(writer io.Writer, disks []StorageAPI, volume string, path s
|
||||
}
|
||||
|
||||
var outSize, outOffset int64
|
||||
// If this is start block, skip unwanted bytes.
|
||||
if block == startBlock {
|
||||
outOffset = bytesToSkip
|
||||
}
|
||||
|
||||
// Total data to be read.
|
||||
outSize = blockSize
|
||||
if length-bytesWritten < blockSize {
|
||||
|
||||
// If this is start block, skip unwanted bytes.
|
||||
if block == startBlock {
|
||||
outOffset = bytesToSkip
|
||||
outSize -= bytesToSkip
|
||||
}
|
||||
|
||||
if length-bytesWritten < outSize {
|
||||
// We should not send more data than what was requested.
|
||||
outSize = length - bytesWritten
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user