From: Howard Chu Date: Sun, 20 Jun 2010 21:28:04 +0000 (+0000) Subject: ITS#6577 potential fix, found using valgrind/drd. please test. X-Git-Tag: MIGRATION_CVS2GIT~573 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bdf52f4fc4ce3d47789ff210d01c10a49498da64;p=openldap ITS#6577 potential fix, found using valgrind/drd. please test. --- diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index 5e0d7bfde3..a2c3ca53fc 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -482,17 +482,19 @@ bdb_cache_find_ndn( *res = eip; return rc; } - } else if ( ei2->bei_state & CACHE_ENTRY_DELETED ) { + } + bdb_cache_entryinfo_lock( ei2 ); + if ( ei2->bei_state & CACHE_ENTRY_DELETED ) { /* In the midst of deleting? Give it a chance to * complete. */ + bdb_cache_entryinfo_unlock( ei2 ); bdb_cache_entryinfo_unlock( eip ); ldap_pvt_thread_yield(); bdb_cache_entryinfo_lock( eip ); *res = eip; return DB_NOTFOUND; } - bdb_cache_entryinfo_lock( ei2 ); bdb_cache_entryinfo_unlock( eip ); eip = ei2;