mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
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:
parent
ad86454580
commit
224a272cf2
@ -19,6 +19,7 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/minio/minio/cmd/logger"
|
"github.com/minio/minio/cmd/logger"
|
||||||
@ -175,7 +176,10 @@ func disksWithAllParts(ctx context.Context, onlineDisks []StorageAPI, partsMetad
|
|||||||
// buffer is passed
|
// buffer is passed
|
||||||
_, hErr := onlineDisk.ReadFile(bucket, partPath, 0, buffer, verifier)
|
_, 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 {
|
switch {
|
||||||
case isCorrupt:
|
case isCorrupt:
|
||||||
fallthrough
|
fallthrough
|
||||||
|
Loading…
Reference in New Issue
Block a user