]> git.sur5r.net Git - openldap/commitdiff
More for ITS#6177
authorHoward Chu <hyc@openldap.org>
Fri, 19 Jun 2009 07:11:01 +0000 (07:11 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 19 Jun 2009 07:11:01 +0000 (07:11 +0000)
servers/slapd/back-bdb/cache.c
servers/slapd/back-bdb/dn2id.c

index e70e1b2f01befc21c583a1c268a889e027b112f2..5d36a2db29c45e72a8cc17e545443ab6632f4f26 100644 (file)
@@ -979,6 +979,9 @@ load1:
                        if ( (*eip)->bei_state & CACHE_ENTRY_DELETED ) {
                                rc = DB_NOTFOUND;
                                bdb_cache_entry_db_unlock( bdb, lock );
+                               bdb_cache_entryinfo_lock( *eip );
+                               (*eip)->bei_finders--;
+                               bdb_cache_entryinfo_unlock( *eip );
                        } else if ( rc == 0 ) {
                                if ( load ) {
                                        if ( !ep) {
index 24c82666768fb3b5b23f380a387b77a05f85ef0f..2d1748c328585fa5ead21ab0487519e911e4155d 100644 (file)
@@ -1156,18 +1156,18 @@ gotit:
                                        if ( bdb_cache_find_id( cx->op, cx->txn, cx->id, &cx->ei,
                                                ID_NOENTRY, NULL ))
                                                continue;
-                                       if ( !cx->ei ||
-                                               ( cx->ei->bei_state & CACHE_ENTRY_NO_KIDS ))
-                                               continue;
-
-                                       ei2 = cx->ei;
-                                       BDB_ID2DISK( cx->id, &cx->nid );
-                                       hdb_dn2idl_internal( cx );
-                                       if ( !BDB_IDL_IS_ZERO( cx->tmp ))
-                                               nokids = 0;
-                                       bdb_cache_entryinfo_lock( ei2 );
-                                       ei2->bei_finders--;
-                                       bdb_cache_entryinfo_unlock( ei2 );
+                                       if ( cx->ei ) {
+                                               ei2 = cx->ei;
+                                               if ( !( ei2->bei_state & CACHE_ENTRY_NO_KIDS )) {
+                                                       BDB_ID2DISK( cx->id, &cx->nid );
+                                                       hdb_dn2idl_internal( cx );
+                                                       if ( !BDB_IDL_IS_ZERO( cx->tmp ))
+                                                               nokids = 0;
+                                               }
+                                               bdb_cache_entryinfo_lock( ei2 );
+                                               ei2->bei_finders--;
+                                               bdb_cache_entryinfo_unlock( ei2 );
+                                       }
                                }
                                cx->depth--;
                                cx->op->o_tmpfree( save, cx->op->o_tmpmemctx );