mirror of
https://github.com/minio/minio.git
synced 2025-07-16 12:21:55 -04:00
fix: extend parentDirIsObject for all parents
This commit is contained in:
parent
83ed1f361b
commit
0a276a25cf
@ -24,6 +24,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"path"
|
||||||
"sort"
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@ -755,7 +756,19 @@ func (s *erasureSets) GetObject(ctx context.Context, bucket, object string, star
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *erasureSets) parentDirIsObject(ctx context.Context, bucket, parent string) bool {
|
func (s *erasureSets) parentDirIsObject(ctx context.Context, bucket, parent string) bool {
|
||||||
return s.getHashedSet(parent).parentDirIsObject(ctx, bucket, parent)
|
var isParentDirObject func(string) bool
|
||||||
|
isParentDirObject = func(p string) bool {
|
||||||
|
if p == "." || p == SlashSeparator {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if s.getHashedSet(p).isObject(ctx, bucket, p) {
|
||||||
|
// If there is already a file at prefix "p", return true.
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// Check if there is a file as one of the parent paths.
|
||||||
|
return isParentDirObject(path.Dir(p))
|
||||||
|
}
|
||||||
|
return isParentDirObject(parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PutObject - writes an object to hashedSet based on the object name.
|
// PutObject - writes an object to hashedSet based on the object name.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user