More for ITS#3188

This commit is contained in:
Howard Chu 2004-06-16 03:29:02 +00:00
parent 87980d56b8
commit 06f3bfb7f9
3 changed files with 23 additions and 6 deletions

View file

@ -794,7 +794,7 @@ bdb_cache_modify(
DB_LOCK *lock )
{
EntryInfo *ei = BEI(e);
int rc = 0;
int rc;
/* Get write lock on data */
rc = bdb_cache_entry_db_relock( env, locker, ei, 1, 0, lock );
@ -825,10 +825,11 @@ bdb_cache_modrdn(
{
EntryInfo *ei = BEI(e), *pei;
struct berval rdn;
int rc = 0;
int rc;
/* 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 ( rc ) return rc;
/* If we've done repeated mods on a cached entry, then e_attrs
* is no longer contiguous with the entry, and must be freed.
@ -911,7 +912,13 @@ bdb_cache_delete(
bdb_cache_entryinfo_lock( ei );
/* Get write lock on the 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 ( rc ) {
/* couldn't lock, undo and give up */
ei->bei_state ^= CACHE_ENTRY_DELETED;
bdb_cache_entryinfo_unlock( ei );
return rc;
}
/* set cache write lock */
ldap_pvt_thread_rdwr_wlock( &cache->c_rwlock );

View file

@ -545,8 +545,13 @@ retry: /* transaction retry */
goto return_results;
}
} else {
bdb_cache_delete( &bdb->bi_cache, e, bdb->bi_dbenv,
rc = bdb_cache_delete( &bdb->bi_cache, e, 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 ) {

View file

@ -1017,8 +1017,13 @@ retry: /* transaction retry */
}
} else {
bdb_cache_modrdn( save, &op->orr_nnewrdn, e, neip,
rc = bdb_cache_modrdn( save, &op->orr_nnewrdn, e, neip,
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 ) {