Ver Fonte

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 [email protected] for finding it out:
https://bugzilla.redhat.com/show_bug.cgi?id=627738#c5

Noriko Hosoi há 15 anos atrás
pai
commit
3501420395
1 ficheiros alterados com 4 adições e 3 exclusões
  1. 4 3
      ldap/servers/slapd/back-ldbm/id2entry.c

+ 4 - 3
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 */
             }