diff --git a/cmd/erasure.go b/cmd/erasure.go index d4d42dec9..9642d8a9d 100644 --- a/cmd/erasure.go +++ b/cmd/erasure.go @@ -91,7 +91,7 @@ func diskErrToDriveState(err error) (state string) { switch { case errors.Is(err, errDiskNotFound) || errors.Is(err, context.DeadlineExceeded): state = madmin.DriveStateOffline - case errors.Is(err, errCorruptedFormat): + case errors.Is(err, errCorruptedFormat) || errors.Is(err, errCorruptedBackend): state = madmin.DriveStateCorrupt case errors.Is(err, errUnformattedDisk): state = madmin.DriveStateUnformatted diff --git a/cmd/storage-errors.go b/cmd/storage-errors.go index 4630d1181..f31107f53 100644 --- a/cmd/storage-errors.go +++ b/cmd/storage-errors.go @@ -30,8 +30,11 @@ var errMaxVersionsExceeded = StorageErr("maximum versions exceeded, please delet // errUnexpected - unexpected error, requires manual intervention. var errUnexpected = StorageErr("unexpected error, please report this issue at https://github.com/minio/minio/issues") -// errCorruptedFormat - corrupted backend format. -var errCorruptedFormat = StorageErr("corrupted backend format, specified drive mount has unexpected previous content") +// errCorruptedFormat - corrupted format. +var errCorruptedFormat = StorageErr("corrupted format") + +// errCorruptedBackend - corrupted backend. +var errCorruptedBackend = StorageErr("corrupted backend") // errUnformattedDisk - unformatted disk found. var errUnformattedDisk = StorageErr("unformatted drive found") diff --git a/cmd/storage-rest-client.go b/cmd/storage-rest-client.go index 56ba937e0..35d1700e9 100644 --- a/cmd/storage-rest-client.go +++ b/cmd/storage-rest-client.go @@ -115,6 +115,8 @@ func toStorageErr(err error) error { return errVolumeAccessDenied case errCorruptedFormat.Error(): return errCorruptedFormat + case errCorruptedBackend.Error(): + return errCorruptedBackend case errUnformattedDisk.Error(): return errUnformattedDisk case errInvalidAccessKeyID.Error(): diff --git a/cmd/xl-storage.go b/cmd/xl-storage.go index f3d58417a..56eff1d4d 100644 --- a/cmd/xl-storage.go +++ b/cmd/xl-storage.go @@ -779,12 +779,12 @@ func (s *xlStorage) checkFormatJSON() (os.FileInfo, error) { return nil, errDiskAccessDenied } logger.LogOnceIf(GlobalContext, err, "check-format-json") // log unexpected errors - return nil, errCorruptedFormat + return nil, errCorruptedBackend } else if osIsPermission(err) { return nil, errDiskAccessDenied } logger.LogOnceIf(GlobalContext, err, "check-format-json") // log unexpected errors - return nil, errCorruptedFormat + return nil, errCorruptedBackend } return fi, nil } @@ -830,12 +830,12 @@ func (s *xlStorage) GetDiskID() (string, error) { return "", errDiskAccessDenied } logger.LogOnceIf(GlobalContext, err, "check-format-json") // log unexpected errors - return "", errCorruptedFormat + return "", errCorruptedBackend } else if osIsPermission(err) { return "", errDiskAccessDenied } logger.LogOnceIf(GlobalContext, err, "check-format-json") // log unexpected errors - return "", errCorruptedFormat + return "", errCorruptedBackend } format := &formatErasureV3{}