diff --git a/cmd/erasure-common.go b/cmd/erasure-common.go index e27cbbb63..0a2bd6748 100644 --- a/cmd/erasure-common.go +++ b/cmd/erasure-common.go @@ -61,7 +61,6 @@ func (er erasureObjects) getOnlineDisks() (newDisks []StorageAPI) { } di, err := disks[i-1].DiskInfo(context.Background()) if err != nil || di.Healing { - // - Do not consume disks which are not reachable // unformatted or simply not accessible for some reason. // diff --git a/cmd/metacache-entries.go b/cmd/metacache-entries.go index 1412b7a1c..1b7f3a79e 100644 --- a/cmd/metacache-entries.go +++ b/cmd/metacache-entries.go @@ -80,6 +80,12 @@ func (e *metaCacheEntry) matches(other *metaCacheEntry, bucket string) bool { return eErr == oErr } + // check both fileInfo's have same number of versions, if not skip + // the `other` entry. + if eFi.NumVersions != oFi.NumVersions { + return false + } + return eFi.ModTime.Equal(oFi.ModTime) && eFi.Size == oFi.Size && eFi.VersionID == oFi.VersionID } @@ -202,12 +208,12 @@ func (m metaCacheEntries) resolve(r *metadataResolutionParams) (selected *metaCa dirExists := 0 objExists := 0 - var selFIV *FileInfo for i := range m { entry := &m[i] if entry.name == "" { continue } + if entry.isDir() { dirExists++ selected = entry @@ -215,19 +221,18 @@ func (m metaCacheEntries) resolve(r *metadataResolutionParams) (selected *metaCa } // Get new entry metadata - fiv, err := entry.fileInfo(r.bucket) - if err != nil { + if _, err := entry.fileInfo(r.bucket); err != nil { continue } - objExists++ - if selFIV == nil { + if selected == nil { + objExists++ selected = entry - selFIV = fiv continue } if selected.matches(entry, r.bucket) { + objExists++ continue } } diff --git a/cmd/metacache-set.go b/cmd/metacache-set.go index f8cfa5e1d..6ccd1a190 100644 --- a/cmd/metacache-set.go +++ b/cmd/metacache-set.go @@ -572,8 +572,11 @@ func (er *erasureObjects) listPath(ctx context.Context, o listPathOptions) (entr }() askDisks := o.AskDisks - listingQuorum := askDisks - 1 - // Special case: ask all disks if the drive count is 4 + if askDisks == 0 { + askDisks = globalAPIConfig.getListQuorum() + } + // make sure atleast default '3' lists object is present. + listingQuorum := askDisks if askDisks == -1 || er.setDriveCount == 4 { askDisks = len(disks) // with 'strict' quorum list on all online disks. listingQuorum = getReadQuorum(er.setDriveCount)