diff --git a/cmd/erasure-decode.go b/cmd/erasure-decode.go index 0ac308e72..6f3ecab02 100644 --- a/cmd/erasure-decode.go +++ b/cmd/erasure-decode.go @@ -202,6 +202,9 @@ func (p *parallelReader) Read(dst [][]byte) ([][]byte, error) { // This will be communicated upstream. p.orgReaders[bufIdx] = nil + if br, ok := p.readers[i].(io.Closer); ok { + br.Close() + } p.readers[i] = nil // Since ReadAt returned error, trigger another read. diff --git a/cmd/erasure-object.go b/cmd/erasure-object.go index 9506e93e6..864d19e47 100644 --- a/cmd/erasure-object.go +++ b/cmd/erasure-object.go @@ -425,11 +425,6 @@ func (er erasureObjects) getObjectWithFileInfo(ctx context.Context, bucket, obje return toObjectErr(err, bucket, object) } } - for i, r := range readers { - if r == nil { - onlineDisks[i] = OfflineDisk - } - } // Track total bytes read from disk and written to the client. totalBytesRead += partLength // partOffset will be valid only for the first part, hence reset it to 0 for