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

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){ for(s3obj_list_t::iterator reiter = notfound_param.notfound_list.begin(); reiter != notfound_param.notfound_list.end(); ++reiter){
int dir_result; int dir_result;
if(0 == (dir_result = directory_empty(reiter->c_str()))){
// Found objects under the path, so the path is directory.
//
std::string dirpath = path + (*reiter); std::string dirpath = path + (*reiter);
if(-ENOTEMPTY == (dir_result = directory_empty(dirpath.c_str()))){
// Found objects under the path, so the path is directory.
// Add stat cache // Add stat cache
if(StatCache::getStatCacheData()->AddStat(dirpath, dummy_header, true)){ // set forcedir=true if(StatCache::getStatCacheData()->AddStat(dirpath, dummy_header, true)){ // set forcedir=true