mirror of
https://github.com/minio/minio.git
synced 2025-01-23 04:33:15 -05:00
Validate prefixes on all sets (#6294)
This PR fixes a regression introduced in 8eb838bf91bf7d98aa2ba9eac976e78c9530225e where hashing technique was used on prefixes to get the right set to perform the operation, this is not correct since prefixes and their corresponding keys might hash to a different value depending on the key length. For prefixes/directories we should look everywhere to support proper quorum based listing. Fixes #6293
This commit is contained in:
parent
c7946ab9ab
commit
0fe9e95250
@ -714,7 +714,15 @@ func (s *xlSets) ListObjects(ctx context.Context, bucket, prefix, marker, delimi
|
||||
}
|
||||
|
||||
isLeafDir := func(bucket, entry string) bool {
|
||||
return s.getHashedSet(entry).isObjectDir(bucket, entry)
|
||||
// Verify prefixes in all sets.
|
||||
var ok bool
|
||||
for _, set := range s.sets {
|
||||
ok = set.isObjectDir(bucket, entry)
|
||||
if ok {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var setDisks = make([][]StorageAPI, len(s.sets))
|
||||
@ -742,7 +750,13 @@ func (s *xlSets) ListObjects(ctx context.Context, bucket, prefix, marker, delimi
|
||||
var objInfo ObjectInfo
|
||||
var err error
|
||||
if hasSuffix(walkResult.entry, slashSeparator) {
|
||||
objInfo, err = s.getHashedSet(walkResult.entry).getObjectInfoDir(ctx, bucket, walkResult.entry)
|
||||
// Verify prefixes in all sets.
|
||||
for _, set := range s.sets {
|
||||
objInfo, err = set.getObjectInfoDir(ctx, bucket, walkResult.entry)
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
objInfo, err = s.getHashedSet(walkResult.entry).getObjectInfo(ctx, bucket, walkResult.entry)
|
||||
}
|
||||
@ -1349,7 +1363,14 @@ func (s *xlSets) listObjectsHeal(ctx context.Context, bucket, prefix, marker, de
|
||||
}
|
||||
|
||||
isLeafDir := func(bucket, entry string) bool {
|
||||
return s.getHashedSet(entry).isObjectDir(bucket, entry)
|
||||
var ok bool
|
||||
for _, set := range s.sets {
|
||||
ok = set.isObjectDir(bucket, entry)
|
||||
if ok {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var setDisks = make([][]StorageAPI, len(s.sets))
|
||||
|
Loading…
x
Reference in New Issue
Block a user