Print log when EINVALID is encountered in storage layer (#13341)

EINVALID from the OS is not a common case and should be logger.
This commit is contained in:
Anis Elleuch 2021-10-04 17:01:52 +01:00 committed by GitHub
parent 94d587e6fc
commit f5be8ba11f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -17,7 +17,12 @@
package cmd
import "errors"
import (
"context"
"errors"
"github.com/minio/minio/internal/logger"
)
// errUnexpected - unexpected error, requires manual intervention.
var errUnexpected = StorageErr("unexpected error, please report this issue at https://github.com/minio/minio/issues")
@ -157,6 +162,7 @@ func osErrToFileErr(err error) error {
return errFaultyDisk
}
if isSysErrInvalidArg(err) {
logger.LogIf(context.Background(), err)
// For some odd calls with O_DIRECT reads
// filesystems can return EINVAL, handle
// these as FileNotFound instead.