From: Kurt Zeilenga Date: Tue, 26 Jan 1999 05:22:58 +0000 (+0000) Subject: cache_set_state( cache, e, 0) cannot occur before lock on parent/root X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~695 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3c67248a651bce3ac4436630e4e468b3a774c740;p=openldap cache_set_state( cache, e, 0) cannot occur before lock on parent/root is released. Some other thread may have cache locked but blocking on parent. Must give up parent lock before acquiring cache lock. --- diff --git a/servers/slapd/back-ldbm/add.c b/servers/slapd/back-ldbm/add.c index 8e8316c196..28fdc31e7b 100644 --- a/servers/slapd/back-ldbm/add.c +++ b/servers/slapd/back-ldbm/add.c @@ -221,8 +221,6 @@ ldbm_back_add( rc = 0; return_results:; - cache_set_state( &li->li_cache, e, 0 ); - if (p != NULL) { /* free parent and writer lock */ cache_return_entry_w( &li->li_cache, p ); @@ -233,6 +231,8 @@ return_results:; pthread_mutex_unlock(&li->li_root_mutex); } + cache_set_state( &li->li_cache, e, 0 ); + /* free entry and writer lock */ cache_return_entry_w( &li->li_cache, e );