From: Howard Chu Date: Wed, 23 Jul 2014 20:06:23 +0000 (-0700) Subject: ITS#7904 writewait patch X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e17878933fc540dcd533e3a96f0a2a393e2a8427;p=openldap ITS#7904 writewait patch Assigned ITS#, tweaking. This ITS includes 4f05d992f2146921dbc13d3477de9918f20172b9 716b35e191fb587b352922c76d65843449d870cb be792fae2ccd4f39ee2b975bcc26a6e21dfc3586 --- diff --git a/servers/slapd/back-mdb/search.c b/servers/slapd/back-mdb/search.c index a79871b74f..c63db9c164 100644 --- a/servers/slapd/back-mdb/search.c +++ b/servers/slapd/back-mdb/search.c @@ -690,12 +690,15 @@ dn2entry_retry: id = mdb_idl_first( candidates, &cursor ); } - cb.sc_writewait = mdb_writewait; - cb.sc_private = &wwctx; wwctx.flag = 0; - wwctx.txn = ltid; - cb.sc_next = op->o_callback; - op->o_callback = &cb; + /* If we're running in our own read txn */ + if ( moi == &opinfo ) { + cb.sc_writewait = mdb_writewait; + cb.sc_private = &wwctx; + wwctx.txn = ltid; + cb.sc_next = op->o_callback; + op->o_callback = &cb; + } while (id != NOID) { @@ -1083,17 +1086,6 @@ loop_continue: id = mdb_idl_next( candidates, &cursor ); } } - /* remove our writewait callback */ - { - slap_callback **scp = &op->o_callback; - while ( *scp ) { - if ( *scp == &cb ) { - *scp = cb.sc_next; - cb.sc_private = NULL; - break; - } - } - } nochange: rs->sr_ctrls = NULL;