From: Jong Hyuk Choi Date: Wed, 11 Jun 2003 17:01:54 +0000 (+0000) Subject: a fix for back-bdb entry cache X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~896 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3f8bb27a83e7683b4b82748f41b69df0a341eba2;p=openldap a fix for back-bdb entry cache --- 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 ); }