mirror of
https://github.com/minio/minio.git
synced 2024-12-25 06:35:56 -05:00
Ignore errors reading fs.json (#7777)
This commit is contained in:
parent
b4ab778cb2
commit
38224a4c1a
10
cmd/fs-v1.go
10
cmd/fs-v1.go
@ -431,8 +431,9 @@ func (fs *FSObjects) CopyObject(ctx context.Context, srcBucket, srcObject, dstBu
|
|||||||
|
|
||||||
// Save objects' metadata in `fs.json`.
|
// Save objects' metadata in `fs.json`.
|
||||||
fsMeta := newFSMetaV1()
|
fsMeta := newFSMetaV1()
|
||||||
if _, err = fsMeta.ReadFrom(ctx, wlk); err != nil && err != io.EOF {
|
if _, err = fsMeta.ReadFrom(ctx, wlk); err != nil {
|
||||||
return oi, toObjectErr(err, srcBucket, srcObject)
|
// For any error to read fsMeta, set default ETag and proceed.
|
||||||
|
fsMeta = fs.defaultFsJSON(srcObject)
|
||||||
}
|
}
|
||||||
|
|
||||||
fsMeta.Meta = srcInfo.UserDefined
|
fsMeta.Meta = srcInfo.UserDefined
|
||||||
@ -710,10 +711,7 @@ func (fs *FSObjects) getObjectInfo(ctx context.Context, bucket, object string) (
|
|||||||
_, rerr := fsMeta.ReadFrom(ctx, rlk.LockedFile)
|
_, rerr := fsMeta.ReadFrom(ctx, rlk.LockedFile)
|
||||||
fs.rwPool.Close(fsMetaPath)
|
fs.rwPool.Close(fsMetaPath)
|
||||||
if rerr != nil {
|
if rerr != nil {
|
||||||
if rerr != io.EOF {
|
// For any error to read fsMeta, set default ETag and proceed.
|
||||||
return oi, rerr
|
|
||||||
}
|
|
||||||
// Set Default ETag, if fs.json is empty
|
|
||||||
fsMeta = fs.defaultFsJSON(object)
|
fsMeta = fs.defaultFsJSON(object)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user