mirror of https://github.com/minio/minio.git
xl: Remove wrong wording for errCorruptedFormat (#18775)
Also add errCorruptedBackend to make it easier to differentiate between corrupted content or something else wrong in the backend drive
This commit is contained in:
parent
42cfdf246f
commit
a47fc75c26
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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():
|
||||
|
|
|
@ -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{}
|
||||
|
|
Loading…
Reference in New Issue