From 224a272cf2c96c3da5ec15f6c10ca68cf82f4d21 Mon Sep 17 00:00:00 2001 From: Aditya Manthramurthy Date: Sun, 29 Jul 2018 02:30:37 -0700 Subject: [PATCH] Fix type of bitrot mismatch error (#6205) The error type `hashMismatchError` is lost when the error is received from a remote disk. Fixes #6201 --- cmd/xl-v1-healing-common.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/xl-v1-healing-common.go b/cmd/xl-v1-healing-common.go index f0c8077df..d7e42eed7 100644 --- a/cmd/xl-v1-healing-common.go +++ b/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