xl: Fix counting offline disks in StorageInfo (#9082)

Recent modification in the code led to incorrect calculation
of offline disks.

This commit saves the endpoint list in a xlObjects then we know
the name of each disk.
This commit is contained in:
kannappanr
2020-03-04 16:18:32 -08:00
committed by GitHub
parent c7ca791c58
commit 07a7f329e7
2 changed files with 18 additions and 16 deletions
+6
View File
@@ -302,10 +302,16 @@ func newXLSets(endpoints Endpoints, format *formatXLV3, setCount int, drivesPerS
s.xlDisks[i] = make([]StorageAPI, drivesPerSet)
s.xlLockers[i] = make([]dsync.NetLocker, drivesPerSet)
var endpoints Endpoints
for j := 0; j < drivesPerSet; j++ {
endpoints = append(endpoints, s.endpoints[i*s.drivesPerSet+j])
}
// Initialize xl objects for a given set.
s.sets[i] = &xlObjects{
getDisks: s.GetDisks(i),
getLockers: s.GetLockers(i),
endpoints: endpoints,
nsMutex: mutex,
bp: bp,
mrfUploadCh: make(chan partialUpload, 10000),