mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Partial fix for ITS#3188.
As Howard noted, additional fixes may be needed in other update routines.
This commit is contained in:
parent
a527174bcb
commit
7537d3d843
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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 ) {
|
||||
|
Loading…
Reference in New Issue
Block a user