disksWithAllParts should use parts if present (#11923)

This commit is contained in:
Harshavardhana 2021-03-30 01:51:00 -07:00 committed by GitHub
parent b8ec365397
commit edf053c5c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -223,7 +223,7 @@ func disksWithAllParts(ctx context.Context, onlineDisks []StorageAPI, partsMetad
}
// Always check data, if we got it.
if len(meta.Data) > 0 || meta.Size == 0 {
if (len(meta.Data) > 0 || meta.Size == 0) && len(meta.Parts) > 0 {
checksumInfo := meta.Erasure.GetChecksumInfo(meta.Parts[0].Number)
dataErrs[i] = bitrotVerify(bytes.NewBuffer(meta.Data),
int64(len(meta.Data)),