Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
db939eeb
Commit
db939eeb
authored
Mar 23, 2018
by
Ondřej Kuzník
Browse files
Protect operation when abandoning
parent
07401e58
Changes
1
Hide whitespace changes
Inline
Side-by-side
servers/lloadd/operation.c
View file @
db939eeb
...
...
@@ -610,7 +610,7 @@ operation_abandon( LloadOperation *op )
ldap_pvt_thread_mutex_lock
(
&
op
->
o_link_mutex
);
c
=
op
->
o_upstream
;
if
(
!
c
)
{
if
(
!
c
||
!
c
->
c_live
)
{
ldap_pvt_thread_mutex_unlock
(
&
op
->
o_link_mutex
);
goto
done
;
}
...
...
@@ -640,6 +640,8 @@ operation_abandon( LloadOperation *op )
}
c
->
c_n_ops_executing
--
;
b
=
(
LloadBackend
*
)
c
->
c_private
;
op
->
o_upstream_refcnt
++
;
CONNECTION_UNLOCK_INCREF
(
c
);
ldap_pvt_thread_mutex_lock
(
&
b
->
b_mutex
);
...
...
@@ -652,14 +654,10 @@ operation_abandon( LloadOperation *op )
}
CONNECTION_LOCK_DECREF
(
c
);
op
->
o_upstream_refcnt
--
;
unlock:
/*
* FIXME: the dance in operation_destroy_from_upstream might be slower than
* optimal as we've done some of the things above already. However, we want
* to clear o_upstream from the op if it's dying, but witnessing and
* navigating the race to do that safely is too complex to copy here.
*/
if
(
!
c
->
c_live
)
{
if
(
!
c
->
c_live
||
!
op
->
o_upstream_refcnt
)
{
operation_destroy_from_upstream
(
op
);
}
if
(
rc
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment