ITS#4768 more be_add fallout

This commit is contained in:
Howard Chu 2006-12-12 21:00:12 +00:00
parent 10ec6feda5
commit 69c4495bc2
4 changed files with 29 additions and 17 deletions

View file

@ -2398,20 +2398,23 @@ send_results:;
if ( op->o_sync ) {
Operation op2 = *op;
SlapReply rs2 = { 0 };
Entry e = { 0 };
Entry *e = entry_alloc();
slap_callback cb = { 0 };
op2.o_tag = LDAP_REQ_ADD;
op2.o_bd = select_backend( &op->o_bd->be_nsuffix[0], 0, 0 );
op2.ora_e = &e;
op2.ora_e = e;
op2.o_callback = &cb;
e.e_name = op->o_bd->be_suffix[0];
e.e_nname = op->o_bd->be_nsuffix[0];
ber_dupbv( &e->e_name, op->o_bd->be_suffix );
ber_dupbv( &e->e_nname, op->o_bd->be_nsuffix );
cb.sc_response = slap_null_cb;
op2.o_bd->be_add( &op2, &rs2 );
if ( op2.ora_e == e )
entry_free( e );
}
#endif /* BACKSQL_SYNCPROV */

View file

@ -1282,6 +1282,8 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
}
op2.o_bd->be_add( &op2, &rs2 );
if ( e == op2.ora_e ) entry_free( e );
e = NULL;
done:
if ( lo->mask & LOG_OP_WRITES )
@ -1390,7 +1392,8 @@ accesslog_unbind( Operation *op, SlapReply *rs )
memset(cids, 0, sizeof( cids ));
op2.o_bd->be_add( &op2, &rs2 );
entry_free( e );
if ( e == op2.ora_e )
entry_free( e );
}
return SLAP_CB_CONTINUE;
}
@ -1428,7 +1431,8 @@ accesslog_abandon( Operation *op, SlapReply *rs )
memset(cids, 0, sizeof( cids ));
op2.o_bd->be_add( &op2, &rs2 );
entry_free( e );
if ( e == op2.ora_e )
entry_free( e );
return SLAP_CB_CONTINUE;
}
@ -1505,8 +1509,8 @@ accesslog_db_root(
Entry *e_ctx;
e = entry_alloc();
e->e_name = *li->li_db->be_suffix;
e->e_nname = *li->li_db->be_nsuffix;
ber_dupbv( &e->e_name, li->li_db->be_suffix );
ber_dupbv( &e->e_nname, li->li_db->be_nsuffix );
attr_merge_one( e, slap_schema.si_ad_objectClass,
&log_container->soc_cname, NULL );
@ -1553,9 +1557,8 @@ accesslog_db_root(
SLAP_DBFLAGS( op->o_bd ) |= SLAP_DBFLAG_NOLASTMOD;
rc = op->o_bd->be_add( op, &rs );
SLAP_DBFLAGS( op->o_bd ) ^= SLAP_DBFLAG_NOLASTMOD;
BER_BVZERO( &e->e_name );
BER_BVZERO( &e->e_nname );
entry_free( e );
if ( e == op->ora_e )
entry_free( e );
}
ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
ldap_pvt_runqueue_stoptask( &slapd_rq, rtask );

View file

@ -216,7 +216,8 @@ merge_entry(
rc = 0;
}
} else {
be_entry_release_w( op, e );
if ( op->ora_e == e )
be_entry_release_w( op, e );
rc = 1;
}

View file

@ -1275,7 +1275,8 @@ syncrepl_message_to_op(
}
if ( op->o_tag == LDAP_REQ_ADD ) {
op->ora_e = entry_alloc();
Entry *e = entry_alloc();
op->ora_e = e;
op->ora_e->e_name = op->o_req_dn;
op->ora_e->e_nname = op->o_req_ndn;
freeReqDn = 0;
@ -1290,7 +1291,8 @@ syncrepl_message_to_op(
"syncrepl_message_to_op: rid %03d be_add %s (%d)\n",
si->si_rid, op->o_req_dn.bv_val, rc );
}
be_entry_release_w( op, op->ora_e );
if ( e == op->ora_e )
be_entry_release_w( op, op->ora_e );
} else {
op->orm_modlist = modlist;
rc = op->o_bd->be_modify( op, &rs );
@ -1738,7 +1740,8 @@ retry_add:;
si->si_rid, rc, 0 );
switch ( rs_add.sr_err ) {
case LDAP_SUCCESS:
be_entry_release_w( op, entry );
if ( op->ora_e == entry )
be_entry_release_w( op, entry );
entry = NULL;
break;
@ -2244,7 +2247,8 @@ syncrepl_add_glue(
op->ora_e = glue;
rc = be->be_add ( op, &rs_add );
if ( rs_add.sr_err == LDAP_SUCCESS ) {
be_entry_release_w( op, glue );
if ( op->ora_e == glue )
be_entry_release_w( op, glue );
} else {
/* incl. ALREADY EXIST */
entry_free( glue );
@ -2277,7 +2281,8 @@ syncrepl_add_glue(
op->ora_e = e;
rc = be->be_add ( op, &rs_add );
if ( rs_add.sr_err == LDAP_SUCCESS ) {
be_entry_release_w( op, e );
if ( op->ora_e == e )
be_entry_release_w( op, e );
} else {
entry_free( e );
}