From 409e09c1e55ab448419a3d62cd8a5704312b2172 Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Tue, 10 May 2016 13:54:58 +0530 Subject: [PATCH] XL/Selfheal: skip reading from disk if ReadFile had returned error. (#1575) --- xl-erasure-v1-healfile.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xl-erasure-v1-healfile.go b/xl-erasure-v1-healfile.go index ab29b2c5c..0725a18f7 100644 --- a/xl-erasure-v1-healfile.go +++ b/xl-erasure-v1-healfile.go @@ -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