Просмотр исходного кода

Resolves: #207457
Summary: (64bitcounters) rhds 7.1 - server stats use 32-bit integers - entrycachehitratio 1503%
Description: additional fix for #207457; e->ep_refcnt should have been
protected by cache->c_mutex, otherwise it breaks the lru list under the stress.

Noriko Hosoi 17 лет назад
Родитель
Сommit
c8f081f0a9
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      ldap/servers/slapd/back-ldbm/cache.c

+ 3 - 3
ldap/servers/slapd/back-ldbm/cache.c

@@ -938,8 +938,8 @@ struct backentry *cache_find_dn(struct cache *cache, const char *dn, unsigned lo
        }
        if (e->ep_refcnt == 0)
            lru_delete(cache, e);
-       PR_Unlock(cache->c_mutex);
        e->ep_refcnt++;
+       PR_Unlock(cache->c_mutex);
        slapi_counter_increment(cache->c_hits);
     } else {
        PR_Unlock(cache->c_mutex);
@@ -969,8 +969,8 @@ struct backentry *cache_find_id(struct cache *cache, ID id)
        }
        if (e->ep_refcnt == 0)
            lru_delete(cache, e);
-       PR_Unlock(cache->c_mutex);
        e->ep_refcnt++;
+       PR_Unlock(cache->c_mutex);
        slapi_counter_increment(cache->c_hits);
     } else {
        PR_Unlock(cache->c_mutex);
@@ -1000,8 +1000,8 @@ struct backentry *cache_find_uuid(struct cache *cache, const char *uuid)
        }
        if (e->ep_refcnt == 0)
            lru_delete(cache, e);
-       PR_Unlock(cache->c_mutex);
        e->ep_refcnt++;
+       PR_Unlock(cache->c_mutex);
        slapi_counter_increment(cache->c_hits);
     } else {
        PR_Unlock(cache->c_mutex);