mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
avoid listing an empty dir without __XLDIR__ (#11427)
``` minio server /tmp/disk{1...4} mc mb myminio/testbucket/ mkdir -p /tmp/disk{1..4}/testbucket/test-prefix/ ``` This would end up being listed in the current master, this PR fixes this situation. If a directory is a leaf dir we should it being listed, since it cannot be deleted anymore with DeleteObject, DeleteObjects() API calls because we natively support directories now. Avoid listing it and let healing purge this folder eventually in the background.
This commit is contained in:
parent
b3f81e75f6
commit
f71e192343
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user