From 53f8b761f1a721f3a61d9ec262c9c76855ad5d4f Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 19 Jun 2009 07:11:01 +0000 Subject: [PATCH] More for ITS#6177 --- servers/slapd/back-bdb/cache.c | 3 +++ servers/slapd/back-bdb/dn2id.c | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index e70e1b2f01..5d36a2db29 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -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) { diff --git a/servers/slapd/back-bdb/dn2id.c b/servers/slapd/back-bdb/dn2id.c index 24c8266676..2d1748c328 100644 --- a/servers/slapd/back-bdb/dn2id.c +++ b/servers/slapd/back-bdb/dn2id.c @@ -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 ); -- 2.39.5