From a71e0483c940fa9390df2b56307a2d454f5be884 Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Tue, 2 Feb 2021 17:04:37 -0800 Subject: [PATCH] Fix nil disks in getOnlineDisksWithHealing (#11419) If a disk is skipped when nil it is still returned. --- cmd/erasure.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/erasure.go b/cmd/erasure.go index c20a1dd25..8fae8b811 100644 --- a/cmd/erasure.go +++ b/cmd/erasure.go @@ -238,6 +238,7 @@ func (er erasureObjects) getOnlineDisksWithHealing() (newDisks []StorageAPI, hea disk := disks[i-1] if disk == nil { + infos[i-1].Error = "nil disk" return } @@ -248,6 +249,7 @@ func (er erasureObjects) getOnlineDisksWithHealing() (newDisks []StorageAPI, hea // // // - Future: skip busy disks + infos[i-1].Error = err.Error() return } @@ -260,7 +262,7 @@ func (er erasureObjects) getOnlineDisksWithHealing() (newDisks []StorageAPI, hea // Check if one of the drives in the set is being healed. // this information is used by crawler to skip healing // this erasure set while it calculates the usage. - if info.Healing { + if info.Healing || info.Error != "" { healing = true continue }