diff --git a/cmd/metacache-walk.go b/cmd/metacache-walk.go index e9130e38e..fc73abf61 100644 --- a/cmd/metacache-walk.go +++ b/cmd/metacache-walk.go @@ -209,7 +209,9 @@ func (s *xlStorage) WalkDir(ctx context.Context, opts WalkDirOptions, wr io.Writ // NOT an object, append to stack (with slash) // If dirObject, but no metadata (which is unexpected) we skip it. if !isDirObj { - dirStack = append(dirStack, meta.name+slashSeparator) + if !isDirEmpty(pathJoin(volumeDir, meta.name+slashSeparator)) { + dirStack = append(dirStack, meta.name+slashSeparator) + } } case isSysErrNotDir(err): // skip