mirror of
https://github.com/minio/minio.git
synced 2025-01-24 13:13:16 -05:00
fs: if fs.json
is empty ignore it while reading metadata. (#3634)
This is needed so that we don't send wrong errors on previously failed PutObject() which would have left a stale `fs.json` entry.
This commit is contained in:
parent
c753b5dfeb
commit
dafdc74605
@ -506,7 +506,12 @@ func (fs fsObjects) getObjectInfo(bucket, object string) (ObjectInfo, error) {
|
||||
// Read from fs metadata only if it exists.
|
||||
defer fs.rwPool.Close(fsMetaPath)
|
||||
if _, rerr := fsMeta.ReadFrom(rlk.LockedFile); rerr != nil {
|
||||
return ObjectInfo{}, toObjectErr(rerr, bucket, object)
|
||||
// `fs.json` can be empty due to previously failed
|
||||
// PutObject() transaction, if we arrive at such
|
||||
// a situation we just ignore and continue.
|
||||
if errorCause(rerr) != io.EOF {
|
||||
return ObjectInfo{}, toObjectErr(rerr, bucket, object)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user