|
|
@ -327,15 +327,22 @@ func (s *xlSets) StorageInfo(ctx context.Context) StorageInfo { |
|
|
|
storageInfo.Backend.Sets[i] = make([]madmin.DriveInfo, s.drivesPerSet) |
|
|
|
storageInfo.Backend.Sets[i] = make([]madmin.DriveInfo, s.drivesPerSet) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
storageDisks, err := initStorageDisks(s.endpoints) |
|
|
|
storageDisks, dErrs := initDisksWithErrors(s.endpoints) |
|
|
|
if err != nil { |
|
|
|
|
|
|
|
return storageInfo |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
defer closeStorageDisks(storageDisks) |
|
|
|
defer closeStorageDisks(storageDisks) |
|
|
|
|
|
|
|
|
|
|
|
formats, sErrs := loadFormatXLAll(storageDisks) |
|
|
|
formats, sErrs := loadFormatXLAll(storageDisks) |
|
|
|
|
|
|
|
|
|
|
|
drivesInfo := formatsToDrivesInfo(s.endpoints, formats, sErrs) |
|
|
|
combineStorageErrors := func(diskErrs []error, storageErrs []error) []error { |
|
|
|
|
|
|
|
for index, err := range diskErrs { |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
storageErrs[index] = err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return storageErrs |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
errs := combineStorageErrors(dErrs, sErrs) |
|
|
|
|
|
|
|
drivesInfo := formatsToDrivesInfo(s.endpoints, formats, errs) |
|
|
|
refFormat, err := getFormatXLInQuorum(formats) |
|
|
|
refFormat, err := getFormatXLInQuorum(formats) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
// Ignore errors here, since this call cannot do anything at
|
|
|
|
// Ignore errors here, since this call cannot do anything at
|
|
|
@ -356,7 +363,6 @@ func (s *xlSets) StorageInfo(ctx context.Context) StorageInfo { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// fill all the offline, missing endpoints as well.
|
|
|
|
// fill all the offline, missing endpoints as well.
|
|
|
|
for _, drive := range drivesInfo { |
|
|
|
for _, drive := range drivesInfo { |
|
|
|
if drive.UUID == "" { |
|
|
|
if drive.UUID == "" { |
|
|
@ -1250,17 +1256,17 @@ func formatsToDrivesInfo(endpoints EndpointList, formats []*formatXLV3, sErrs [] |
|
|
|
Endpoint: drive, |
|
|
|
Endpoint: drive, |
|
|
|
State: madmin.DriveStateMissing, |
|
|
|
State: madmin.DriveStateMissing, |
|
|
|
}) |
|
|
|
}) |
|
|
|
case sErrs[i] == errCorruptedFormat: |
|
|
|
case sErrs[i] == errDiskNotFound: |
|
|
|
beforeDrives = append(beforeDrives, madmin.DriveInfo{ |
|
|
|
beforeDrives = append(beforeDrives, madmin.DriveInfo{ |
|
|
|
UUID: "", |
|
|
|
UUID: "", |
|
|
|
Endpoint: drive, |
|
|
|
Endpoint: drive, |
|
|
|
State: madmin.DriveStateCorrupt, |
|
|
|
State: madmin.DriveStateOffline, |
|
|
|
}) |
|
|
|
}) |
|
|
|
default: |
|
|
|
default: |
|
|
|
beforeDrives = append(beforeDrives, madmin.DriveInfo{ |
|
|
|
beforeDrives = append(beforeDrives, madmin.DriveInfo{ |
|
|
|
UUID: "", |
|
|
|
UUID: "", |
|
|
|
Endpoint: drive, |
|
|
|
Endpoint: drive, |
|
|
|
State: madmin.DriveStateOffline, |
|
|
|
State: madmin.DriveStateCorrupt, |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|