From e99bc177c0e03e4117d346b3d8c8f32df049c50f Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 3 Aug 2020 13:20:49 -0700 Subject: [PATCH] fix: allow FS mode situations when conflicting files exist (#10185) conflicting files can exist on FS at `.minio.sys/buckets/testbucket/policy.json/`, this is an expected valid scenario for FS mode allow it to work, i.e ignore and move forward --- cmd/bucket-metadata.go | 6 ++++++ cmd/config-common.go | 5 ----- cmd/fs-v1-helpers.go | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/bucket-metadata.go b/cmd/bucket-metadata.go index cd0b319e0..a1d631354 100644 --- a/cmd/bucket-metadata.go +++ b/cmd/bucket-metadata.go @@ -265,6 +265,12 @@ func (b *BucketMetadata) convertLegacyConfigs(ctx context.Context, objectAPI Obj configData, err := readConfig(ctx, objectAPI, configFile) if err != nil { + switch err.(type) { + case ObjectExistsAsDirectory: + // in FS mode it possible that we have actual + // files in this folder with `.minio.sys/buckets/bucket/configFile` + continue + } if errors.Is(err, errConfigNotFound) { // legacy file config not found, proceed to look for new metadata. continue diff --git a/cmd/config-common.go b/cmd/config-common.go index 1bb1a202a..01a042f5b 100644 --- a/cmd/config-common.go +++ b/cmd/config-common.go @@ -21,7 +21,6 @@ import ( "context" "errors" - "github.com/minio/minio/cmd/logger" "github.com/minio/minio/pkg/hash" ) @@ -36,8 +35,6 @@ func readConfig(ctx context.Context, objAPI ObjectLayer, configFile string) ([]b return nil, errConfigNotFound } - logger.GetReqInfo(ctx).AppendTags("configFile", configFile) - logger.LogIf(ctx, err) return nil, err } @@ -74,8 +71,6 @@ func checkConfig(ctx context.Context, objAPI ObjectLayer, configFile string) err return errConfigNotFound } - logger.GetReqInfo(ctx).AppendTags("configFile", configFile) - logger.LogIf(ctx, err) return err } return nil diff --git a/cmd/fs-v1-helpers.go b/cmd/fs-v1-helpers.go index 9aed0a29c..c12961bb6 100644 --- a/cmd/fs-v1-helpers.go +++ b/cmd/fs-v1-helpers.go @@ -256,7 +256,6 @@ func fsOpenFile(ctx context.Context, readPath string, offset int64) (io.ReadClos // Verify if its not a regular file, since subsequent Seek is undefined. if !st.Mode().IsRegular() { - logger.LogIf(ctx, errIsNotRegular) return nil, 0, errIsNotRegular }