mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
ITS#7628 fix back-mdb txn refcount
If multiple ops used the same opinfo the refcount wasn't being decremented
This commit is contained in:
parent
7c6b599de6
commit
99e22a4366
@ -438,6 +438,8 @@ return_results:
|
|||||||
if ( opinfo.moi_oe.oe_key ) {
|
if ( opinfo.moi_oe.oe_key ) {
|
||||||
LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.moi_oe, OpExtra, oe_next );
|
LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.moi_oe, OpExtra, oe_next );
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
moi->moi_ref--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( success == LDAP_SUCCESS ) {
|
if( success == LDAP_SUCCESS ) {
|
||||||
|
@ -138,6 +138,8 @@ done:
|
|||||||
if ( moi == &opinfo ) {
|
if ( moi == &opinfo ) {
|
||||||
mdb_txn_reset( moi->moi_txn );
|
mdb_txn_reset( moi->moi_txn );
|
||||||
LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
|
LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
|
||||||
|
} else {
|
||||||
|
moi->moi_ref--;
|
||||||
}
|
}
|
||||||
/* free entry and reader lock */
|
/* free entry and reader lock */
|
||||||
if( e != NULL ) {
|
if( e != NULL ) {
|
||||||
|
@ -130,6 +130,8 @@ done:
|
|||||||
if ( moi == &opinfo ) {
|
if ( moi == &opinfo ) {
|
||||||
mdb_txn_reset( moi->moi_txn );
|
mdb_txn_reset( moi->moi_txn );
|
||||||
LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
|
LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
|
||||||
|
} else {
|
||||||
|
moi->moi_ref--;
|
||||||
}
|
}
|
||||||
/* free entry */
|
/* free entry */
|
||||||
if ( e != NULL ) {
|
if ( e != NULL ) {
|
||||||
|
@ -457,6 +457,8 @@ return_results:
|
|||||||
if ( opinfo.moi_oe.oe_key ) {
|
if ( opinfo.moi_oe.oe_key ) {
|
||||||
LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.moi_oe, OpExtra, oe_next );
|
LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.moi_oe, OpExtra, oe_next );
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
moi->moi_ref--;
|
||||||
}
|
}
|
||||||
|
|
||||||
send_ldap_result( op, rs );
|
send_ldap_result( op, rs );
|
||||||
|
@ -505,7 +505,8 @@ mdb_opinfo_get( Operation *op, struct mdb_info *mdb, int rdonly, mdb_op_info **m
|
|||||||
moi->moi_ref = 0;
|
moi->moi_ref = 0;
|
||||||
}
|
}
|
||||||
if ( renew ) {
|
if ( renew ) {
|
||||||
mdb_txn_renew( moi->moi_txn );
|
rc = mdb_txn_renew( moi->moi_txn );
|
||||||
|
assert(!rc);
|
||||||
}
|
}
|
||||||
moi->moi_ref++;
|
moi->moi_ref++;
|
||||||
if ( *moip != moi )
|
if ( *moip != moi )
|
||||||
|
@ -671,6 +671,8 @@ done:
|
|||||||
if ( opinfo.moi_oe.oe_key ) {
|
if ( opinfo.moi_oe.oe_key ) {
|
||||||
LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.moi_oe, OpExtra, oe_next );
|
LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.moi_oe, OpExtra, oe_next );
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
moi->moi_ref--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( e != NULL ) {
|
if( e != NULL ) {
|
||||||
|
@ -656,6 +656,8 @@ done:
|
|||||||
if ( opinfo.moi_oe.oe_key ) {
|
if ( opinfo.moi_oe.oe_key ) {
|
||||||
LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.moi_oe, OpExtra, oe_next );
|
LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.moi_oe, OpExtra, oe_next );
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
moi->moi_ref--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( preread_ctrl != NULL && (*preread_ctrl) != NULL ) {
|
if( preread_ctrl != NULL && (*preread_ctrl) != NULL ) {
|
||||||
|
@ -76,6 +76,8 @@ done:;
|
|||||||
if ( moi == &opinfo ) {
|
if ( moi == &opinfo ) {
|
||||||
mdb_txn_reset( moi->moi_txn );
|
mdb_txn_reset( moi->moi_txn );
|
||||||
LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
|
LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
|
||||||
|
} else {
|
||||||
|
moi->moi_ref--;
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -142,6 +142,8 @@ done:
|
|||||||
if ( moi == &opinfo ) {
|
if ( moi == &opinfo ) {
|
||||||
mdb_txn_reset( moi->moi_txn );
|
mdb_txn_reset( moi->moi_txn );
|
||||||
LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
|
LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
|
||||||
|
} else {
|
||||||
|
moi->moi_ref--;
|
||||||
}
|
}
|
||||||
if ( e )
|
if ( e )
|
||||||
mdb_entry_return( op, e );
|
mdb_entry_return( op, e );
|
||||||
|
@ -1058,6 +1058,8 @@ done:
|
|||||||
if ( moi == &opinfo ) {
|
if ( moi == &opinfo ) {
|
||||||
mdb_txn_reset( moi->moi_txn );
|
mdb_txn_reset( moi->moi_txn );
|
||||||
LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
|
LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
|
||||||
|
} else {
|
||||||
|
moi->moi_ref--;
|
||||||
}
|
}
|
||||||
if( rs->sr_v2ref ) {
|
if( rs->sr_v2ref ) {
|
||||||
ber_bvarray_free( rs->sr_v2ref );
|
ber_bvarray_free( rs->sr_v2ref );
|
||||||
|
Loading…
Reference in New Issue
Block a user