diff --git a/configure.ac b/configure.ac index b5758fa..14141d6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(s3fs, 1.64) +AC_INIT(s3fs, 1.65) AC_CANONICAL_SYSTEM diff --git a/src/cache.cpp b/src/cache.cpp index acb2e25..6b55da9 100644 --- a/src/cache.cpp +++ b/src/cache.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -124,6 +125,15 @@ void delete_stat_cache_entry(const char *path) if(iter != stat_cache.end()){ stat_cache.erase(iter); } + if(0 < strlen(path) && '/' != path[strlen(path) - 1]){ + // If there is "path/" cache, delete it. + string strpath = path; + strpath += "/"; + iter = stat_cache.find(strpath.c_str()); + if(iter != stat_cache.end()){ + stat_cache.erase(iter); + } + } pthread_mutex_unlock(&stat_cache_lock); }