Fix type of bitrot mismatch error (#6205)

The error type `hashMismatchError` is lost when the error is received
from a remote disk.

Fixes #6201
This commit is contained in:
Aditya Manthramurthy 2018-07-29 02:30:37 -07:00 committed by Nitish Tiwari
parent ad86454580
commit 224a272cf2

View File

@ -19,6 +19,7 @@ package cmd
import (
"context"
"path/filepath"
"strings"
"time"
"github.com/minio/minio/cmd/logger"
@ -175,7 +176,10 @@ func disksWithAllParts(ctx context.Context, onlineDisks []StorageAPI, partsMetad
// buffer is passed
_, hErr := onlineDisk.ReadFile(bucket, partPath, 0, buffer, verifier)
_, isCorrupt := hErr.(hashMismatchError)
isCorrupt := false
if hErr != nil {
isCorrupt = strings.HasPrefix(hErr.Error(), "Bitrot verification mismatch - expected ")
}
switch {
case isCorrupt:
fallthrough