XL/Selfheal: skip reading from disk if ReadFile had returned error. (#1575)

This commit is contained in:
Krishna Srinivas 2016-05-10 13:54:58 +05:30 committed by Harshavardhana
parent c314a98c1a
commit 409e09c1e5

View File

@ -117,6 +117,10 @@ func (xl XL) healFile(volume string, path string) error {
// Skip reading if the part needs healing.
continue
}
if reader == nil {
// If ReadFile() had returned error, do not read from this disk.
continue
}
_, err = io.ReadFull(reader, enBlocks[index])
if err != nil && err != io.ErrUnexpectedEOF {
enBlocks[index] = nil