mirror of
https://github.com/minio/minio.git
synced 2025-07-15 03:41:53 -04:00
Walk() and Merge code can return dir__XLDIR__ as the last element on a page list and dir__XLDIR__ as the first element in the next list page. dir__XLDIR__ is shown in the second-page list because the marker set to dir/ is meant to skip dir/ and not dir__XLDIR__ To fix this, the code will avoid adding the marker itself to the listing result.
This commit is contained in:
parent
5df7bbf9f9
commit
851f3c5f0c
@ -913,6 +913,12 @@ func (z *erasureServerSets) listObjects(ctx context.Context, bucket, prefix, mar
|
|||||||
|
|
||||||
for _, entry := range entries.Files {
|
for _, entry := range entries.Files {
|
||||||
objInfo := entry.ToObjectInfo(entry.Volume, entry.Name)
|
objInfo := entry.ToObjectInfo(entry.Volume, entry.Name)
|
||||||
|
// Always avoid including the marker in the result, this is
|
||||||
|
// needed to avoid including dir__XLDIR__ and dir/ twice in
|
||||||
|
// different listing pages
|
||||||
|
if objInfo.Name == marker {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if HasSuffix(objInfo.Name, SlashSeparator) && !recursive {
|
if HasSuffix(objInfo.Name, SlashSeparator) && !recursive {
|
||||||
loi.Prefixes = append(loi.Prefixes, objInfo.Name)
|
loi.Prefixes = append(loi.Prefixes, objInfo.Name)
|
||||||
continue
|
continue
|
||||||
@ -1324,6 +1330,12 @@ func (z *erasureServerSets) listObjectVersions(ctx context.Context, bucket, pref
|
|||||||
for _, entry := range entries.FilesVersions {
|
for _, entry := range entries.FilesVersions {
|
||||||
for _, version := range entry.Versions {
|
for _, version := range entry.Versions {
|
||||||
objInfo := version.ToObjectInfo(bucket, entry.Name)
|
objInfo := version.ToObjectInfo(bucket, entry.Name)
|
||||||
|
// Always avoid including the marker in the result, this is
|
||||||
|
// needed to avoid including dir__XLDIR__ and dir/ twice in
|
||||||
|
// different listing pages
|
||||||
|
if objInfo.Name == marker && objInfo.VersionID == versionMarker {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if HasSuffix(objInfo.Name, SlashSeparator) && !recursive {
|
if HasSuffix(objInfo.Name, SlashSeparator) && !recursive {
|
||||||
loi.Prefixes = append(loi.Prefixes, objInfo.Name)
|
loi.Prefixes = append(loi.Prefixes, objInfo.Name)
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user