Commit 43c4d1d0 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

ITS#6177

parent c2261c69
...@@ -29,6 +29,7 @@ OpenLDAP 2.4.17 Engineering ...@@ -29,6 +29,7 @@ OpenLDAP 2.4.17 Engineering
Fixed slapd some abandon and cancel race conditions (ITS#6104) Fixed slapd some abandon and cancel race conditions (ITS#6104)
Fixed slapd tls context after changes (ITS#6135) Fixed slapd tls context after changes (ITS#6135)
Fixed slapd-bdb/hdb adjust dncachesize if too low (ITS#6176) Fixed slapd-bdb/hdb adjust dncachesize if too low (ITS#6176)
Fixed slapd-bdb/hdb crashes during delete (ITS#6177)
Fixed slapd-hdb freeing of already freed entries (ITS#6074) Fixed slapd-hdb freeing of already freed entries (ITS#6074)
Fixed slapd-hdb entryinfo cleanup (ITS#6088) Fixed slapd-hdb entryinfo cleanup (ITS#6088)
Fixed slapd-hdb dncache lockups (ITS#6095) Fixed slapd-hdb dncache lockups (ITS#6095)
......
...@@ -979,6 +979,9 @@ load1: ...@@ -979,6 +979,9 @@ load1:
if ( (*eip)->bei_state & CACHE_ENTRY_DELETED ) { if ( (*eip)->bei_state & CACHE_ENTRY_DELETED ) {
rc = DB_NOTFOUND; rc = DB_NOTFOUND;
bdb_cache_entry_db_unlock( bdb, lock ); bdb_cache_entry_db_unlock( bdb, lock );
bdb_cache_entryinfo_lock( *eip );
(*eip)->bei_finders--;
bdb_cache_entryinfo_unlock( *eip );
} else if ( rc == 0 ) { } else if ( rc == 0 ) {
if ( load ) { if ( load ) {
if ( !ep) { if ( !ep) {
...@@ -1336,7 +1339,7 @@ bdb_cache_delete( ...@@ -1336,7 +1339,7 @@ bdb_cache_delete(
DB_LOCK *lock ) DB_LOCK *lock )
{ {
EntryInfo *ei = BEI(e); EntryInfo *ei = BEI(e);
int rc; int rc, busy = 0;
assert( e->e_private != NULL ); assert( e->e_private != NULL );
...@@ -1346,8 +1349,24 @@ bdb_cache_delete( ...@@ -1346,8 +1349,24 @@ bdb_cache_delete(
/* Set this early, warn off any queriers */ /* Set this early, warn off any queriers */
ei->bei_state |= CACHE_ENTRY_DELETED; ei->bei_state |= CACHE_ENTRY_DELETED;
if (( ei->bei_state & ( CACHE_ENTRY_NOT_LINKED |
CACHE_ENTRY_LOADING | CACHE_ENTRY_ONELEVEL )) ||
ei->bei_finders > 0 )
busy = 1;
bdb_cache_entryinfo_unlock( ei ); bdb_cache_entryinfo_unlock( ei );
while ( busy ) {
ldap_pvt_thread_yield();
busy = 0;
bdb_cache_entryinfo_lock( ei );
if (( ei->bei_state & ( CACHE_ENTRY_NOT_LINKED |
CACHE_ENTRY_LOADING | CACHE_ENTRY_ONELEVEL )) ||
ei->bei_finders > 0 )
busy = 1;
bdb_cache_entryinfo_unlock( ei );
}
/* Get write lock on the data */ /* Get write lock on the data */
rc = bdb_cache_entry_db_relock( bdb, txn, ei, 1, 0, lock ); rc = bdb_cache_entry_db_relock( bdb, txn, ei, 1, 0, lock );
if ( rc ) { if ( rc ) {
......
...@@ -1156,18 +1156,18 @@ gotit: ...@@ -1156,18 +1156,18 @@ gotit:
if ( bdb_cache_find_id( cx->op, cx->txn, cx->id, &cx->ei, if ( bdb_cache_find_id( cx->op, cx->txn, cx->id, &cx->ei,
ID_NOENTRY, NULL )) ID_NOENTRY, NULL ))
continue; continue;
if ( !cx->ei || if ( cx->ei ) {
( cx->ei->bei_state & CACHE_ENTRY_NO_KIDS )) ei2 = cx->ei;
continue; if ( !( ei2->bei_state & CACHE_ENTRY_NO_KIDS )) {
BDB_ID2DISK( cx->id, &cx->nid );
ei2 = cx->ei; hdb_dn2idl_internal( cx );
BDB_ID2DISK( cx->id, &cx->nid ); if ( !BDB_IDL_IS_ZERO( cx->tmp ))
hdb_dn2idl_internal( cx ); nokids = 0;
if ( !BDB_IDL_IS_ZERO( cx->tmp )) }
nokids = 0; bdb_cache_entryinfo_lock( ei2 );
bdb_cache_entryinfo_lock( ei2 ); ei2->bei_finders--;
ei2->bei_finders--; bdb_cache_entryinfo_unlock( ei2 );
bdb_cache_entryinfo_unlock( ei2 ); }
} }
cx->depth--; cx->depth--;
cx->op->o_tmpfree( save, cx->op->o_tmpmemctx ); cx->op->o_tmpfree( save, cx->op->o_tmpmemctx );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment