Still seeing readdir issues in 2.7.1
Hi Dang, We are still seeing ls hang issue (which was supposed to be fixed by b8fe6364c61c4ac0c086c67b4d06685beb55bc5f), on top of that there is one more issue, sometimes we are getting EOF pre-maturely for readdir. For example, while running rm -rf *, even though the command finishes successfully, doing a subsequent ls again in the same directory gives new listing (includes entries which were not seen previously). It seems both of these are issue are related. Do you think the below patch will help? It's untested (yet) and a shot in the dark. Basically I want to switch back to the same behaviour for mdcache_readdir_cached() which was before these two commits: 5dc6a70ed42275a4f6772b9802e79f23dc25fa73 and 654dd706d22663c6ae6029e0c8c5814fe0d6ff6a. What do you think? diff --git a/src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_helpers.c b/src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_helpers.c index 20d6365..912324f 100644 --- a/src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_helpers.c +++ b/src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_helpers.c @@ -2826,8 +2826,14 @@ PTHREAD_RWLOCK_unlock(&directory->content_lock); PTHREAD_RWLOCK_wrlock(&directory->content_lock); has_write = true; - first_pass = true; - chunk = NULL; + /* reload the chunk after taking write lock */ + if (chunk && + mdcache_avl_lookup_ck(directory, next_ck, &dirent)) { + chunk = dirent->chunk; + } else { + chunk = NULL; + first_pass = true; + } goto again; } Thanks, Ashish
participants (1)
-
Ashish Sangwan