summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2010-09-02 10:49:01 -0700
committerNoriko Hosoi <nhosoi@redhat.com>2010-09-02 10:49:01 -0700
commit350142039530c439bd98f3af5ec858d98134ac25 (patch)
treef936c838171acf1f24df85d29b06d9c3b7240ad8
parentea408efe551ad837b08423f6d32b5433ab8dfe2b (diff)
downloadds-350142039530c439bd98f3af5ec858d98134ac25.tar.gz
ds-350142039530c439bd98f3af5ec858d98134ac25.tar.xz
ds-350142039530c439bd98f3af5ec858d98134ac25.zip
Bug 627738 - The cn=monitor statistics entries for the dnentry cache
do not change or change very rarely https://bugzilla.redhat.com/show_bug.cgi?id=627738 Description: Change made in this commit: cc36301a7cae6737d9f8a0e53bed653a52130a1d for the following bug introduced a missing-cache-return bug: id2entry_add_ext replaces an dn instance in the dn cache even if the DN value is identical. Replace it only when they don't match. Thanks to andrey.ivanov@polytechnique.fr for finding it out: https://bugzilla.redhat.com/show_bug.cgi?id=627738#c5
-rw-r--r--ldap/servers/slapd/back-ldbm/id2entry.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ldap/servers/slapd/back-ldbm/id2entry.c b/ldap/servers/slapd/back-ldbm/id2entry.c
index 40512146..15d742c7 100644
--- a/ldap/servers/slapd/back-ldbm/id2entry.c
+++ b/ldap/servers/slapd/back-ldbm/id2entry.c
@@ -102,9 +102,10 @@ id2entry_add_ext( backend *be, struct backentry *e, back_txn *txn, int encrypt
/* If the ID already exists in the DN cache && the DNs do not match,
* replace it. */
- if ((CACHE_ADD( &inst->inst_dncache, bdn, &oldbdn ) == 1) &&
- (slapi_sdn_compare(sdn, oldbdn->dn_sdn))) {
- cache_replace( &inst->inst_dncache, oldbdn, bdn );
+ if (CACHE_ADD( &inst->inst_dncache, bdn, &oldbdn ) == 1) {
+ if (slapi_sdn_compare(sdn, oldbdn->dn_sdn)) {
+ cache_replace( &inst->inst_dncache, oldbdn, bdn );
+ }
CACHE_RETURN(&inst->inst_dncache, &oldbdn); /* to free oldbdn */
}