fix: ListBucket edge cases (#2399)

This commit is contained in:
Jason Carpenter 2024-02-02 20:24:40 -08:00 committed by GitHub
parent 54aa278df0
commit 5e6f21a9ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 3 deletions

View File

@ -3370,10 +3370,9 @@ static int readdir_multi_head(const char* path, const S3ObjList& head, void* buf
for(s3obj_list_t::iterator reiter = notfound_param.notfound_list.begin(); reiter != notfound_param.notfound_list.end(); ++reiter){
int dir_result;
if(0 == (dir_result = directory_empty(reiter->c_str()))){
std::string dirpath = path + (*reiter);
if(-ENOTEMPTY == (dir_result = directory_empty(dirpath.c_str()))){
// Found objects under the path, so the path is directory.
//
std::string dirpath = path + (*reiter);
// Add stat cache
if(StatCache::getStatCacheData()->AddStat(dirpath, dummy_header, true)){ // set forcedir=true