mirror of
https://github.com/minio/minio.git
synced 2025-04-15 00:35:31 -04:00
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
This commit is contained in:
parent
b68bc75dad
commit
e99bc177c0
@ -265,6 +265,12 @@ func (b *BucketMetadata) convertLegacyConfigs(ctx context.Context, objectAPI Obj
|
|||||||
|
|
||||||
configData, err := readConfig(ctx, objectAPI, configFile)
|
configData, err := readConfig(ctx, objectAPI, configFile)
|
||||||
if err != nil {
|
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) {
|
if errors.Is(err, errConfigNotFound) {
|
||||||
// legacy file config not found, proceed to look for new metadata.
|
// legacy file config not found, proceed to look for new metadata.
|
||||||
continue
|
continue
|
||||||
|
@ -21,7 +21,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/minio/minio/cmd/logger"
|
|
||||||
"github.com/minio/minio/pkg/hash"
|
"github.com/minio/minio/pkg/hash"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -36,8 +35,6 @@ func readConfig(ctx context.Context, objAPI ObjectLayer, configFile string) ([]b
|
|||||||
return nil, errConfigNotFound
|
return nil, errConfigNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.GetReqInfo(ctx).AppendTags("configFile", configFile)
|
|
||||||
logger.LogIf(ctx, err)
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,8 +71,6 @@ func checkConfig(ctx context.Context, objAPI ObjectLayer, configFile string) err
|
|||||||
return errConfigNotFound
|
return errConfigNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.GetReqInfo(ctx).AppendTags("configFile", configFile)
|
|
||||||
logger.LogIf(ctx, err)
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -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.
|
// Verify if its not a regular file, since subsequent Seek is undefined.
|
||||||
if !st.Mode().IsRegular() {
|
if !st.Mode().IsRegular() {
|
||||||
logger.LogIf(ctx, errIsNotRegular)
|
|
||||||
return nil, 0, errIsNotRegular
|
return nil, 0, errIsNotRegular
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user