From bdf52f4fc4ce3d47789ff210d01c10a49498da64 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 20 Jun 2010 21:28:04 +0000 Subject: [PATCH] ITS#6577 potential fix, found using valgrind/drd. please test. --- servers/slapd/back-bdb/cache.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; -- 2.39.5