Fix type of bitrot mismatch error (#6205)

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

Fixes #6201
master
Aditya Manthramurthy 6 years ago committed by Nitish Tiwari
parent ad86454580
commit 224a272cf2
  1. 6
      cmd/xl-v1-healing-common.go

@ -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

Loading…
Cancel
Save