[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm cache.c, 1.7, 1.8

Noriko Hosoi nhosoi at fedoraproject.org
Tue Nov 11 21:31:44 UTC 2008


Author: nhosoi

Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv22092

Modified Files:
	cache.c 
Log Message:
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.



Index: cache.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/cache.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- cache.c	24 Oct 2008 22:36:59 -0000	1.7
+++ cache.c	11 Nov 2008 21:31:41 -0000	1.8
@@ -938,8 +938,8 @@
        }
        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 @@
        }
        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 @@
        }
        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);




More information about the Fedora-directory-commits mailing list