Partial fix for ITS#3188.

As Howard noted, additional fixes may be needed in other update routines.
This commit is contained in:
Kurt Zeilenga 2004-06-15 21:13:40 +00:00
parent a527174bcb
commit 7537d3d843
2 changed files with 14 additions and 8 deletions

View File

@ -794,19 +794,20 @@ bdb_cache_modify(
DB_LOCK *lock )
{
EntryInfo *ei = BEI(e);
int rc = 0;
/* Get write lock on data */
bdb_cache_entry_db_relock( env, locker, ei, 1, 0, lock );
rc = bdb_cache_entry_db_relock( env, locker, ei, 1, 0, lock );
/* If we've done repeated mods on a cached entry, then e_attrs
* is no longer contiguous with the entry, and must be freed.
*/
if ( (void *)e->e_attrs != (void *)(e+1) ) {
attrs_free( e->e_attrs );
if ( ! rc ) {
if ( (void *)e->e_attrs != (void *)(e+1) ) {
attrs_free( e->e_attrs );
}
e->e_attrs = newAttrs;
}
e->e_attrs = newAttrs;
return 0;
return rc;
}
/*

View File

@ -659,7 +659,12 @@ retry: /* transaction retry */
goto return_results;
}
} else {
bdb_cache_modify( e, dummy.e_attrs, bdb->bi_dbenv, locker, &lock );
rc = bdb_cache_modify( e, dummy.e_attrs, bdb->bi_dbenv, locker, &lock );
switch( rc ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
goto retry;
}
if ( LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo )) {
if ( ctxcsn_added ) {