From f5be8ba11fa14968850fb63a9f3f6ce85466cff0 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Mon, 4 Oct 2021 17:01:52 +0100 Subject: [PATCH] Print log when EINVALID is encountered in storage layer (#13341) EINVALID from the OS is not a common case and should be logger. --- cmd/storage-errors.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/storage-errors.go b/cmd/storage-errors.go index 070e7848a..b45779305 100644 --- a/cmd/storage-errors.go +++ b/cmd/storage-errors.go @@ -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.