mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -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:
@@ -209,8 +209,10 @@ 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 {
|
||||
if !isDirEmpty(pathJoin(volumeDir, meta.name+slashSeparator)) {
|
||||
dirStack = append(dirStack, meta.name+slashSeparator)
|
||||
}
|
||||
}
|
||||
case isSysErrNotDir(err):
|
||||
// skip
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user