From 3f8bb27a83e7683b4b82748f41b69df0a341eba2 Mon Sep 17 00:00:00 2001 From: Jong Hyuk Choi Date: Wed, 11 Jun 2003 17:01:54 +0000 Subject: [PATCH] a fix for back-bdb entry cache --- servers/slapd/back-bdb/cache.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index 36b46089bd..b980ee39e4 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -239,6 +239,11 @@ bdb_entryinfo_add_internal( */ if ( bdb_cache_entry_db_lock( env, locker, elru, 1, 1, &lock ) == 0 ) { + if ( !elru->bei_e ) { + bdb_cache_entryinfo_unlock( elru->bei_parent ); + bdb_cache_entry_db_unlock( env, &lock ); + continue; + } /* Need to lock parent to delete child */ if ( ldap_pvt_thread_mutex_trylock( &elru->bei_parent->bei_kids_mutex )) { @@ -564,7 +569,7 @@ again: ldap_pvt_thread_rdwr_rlock( &bdb->bi_cache.c_rwlock ); if ( *eip && rc == 0 ) { if ( (*eip)->bei_state & CACHE_ENTRY_DELETED ) { rc = DB_NOTFOUND; - } else if (!(*eip)->bei_e ) { + } else if ( !(*eip)->bei_e ) { if (!ep) { rc = bdb_id2entry( op->o_bd, tid, id, &ep ); } -- 2.39.5