From: Howard Chu Date: Wed, 28 Jan 2009 02:03:07 +0000 (+0000) Subject: Reverse lock order when detaching op X-Git-Tag: ACLCHECK_0~923 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=461ffd51f6934359c5351ec359e0895cddf0436b;p=openldap Reverse lock order when detaching op --- diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index ef20194d89..2f8686acec 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -2123,17 +2123,16 @@ syncprov_search_response( Operation *op, SlapReply *rs ) op->o_tmpfree( cookie.bv_val, op->o_tmpmemctx ); /* Detach this Op from frontend control */ - ldap_pvt_thread_mutex_lock( &ss->ss_so->s_mutex ); ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex ); /* But not if this connection was closed along the way */ if ( op->o_abandon ) { ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex ); - ldap_pvt_thread_mutex_unlock( &ss->ss_so->s_mutex ); /* syncprov_ab_cleanup will free this syncop */ return SLAPD_ABANDON; } else { + ldap_pvt_thread_mutex_lock( &ss->ss_so->s_mutex ); /* Turn off the refreshing flag */ ss->ss_so->s_flags ^= PS_IS_REFRESHING; @@ -2144,8 +2143,8 @@ syncprov_search_response( Operation *op, SlapReply *rs ) /* If there are queued responses, fire them off */ if ( ss->ss_so->s_res ) syncprov_qstart( ss->ss_so ); + ldap_pvt_thread_mutex_unlock( &ss->ss_so->s_mutex ); } - ldap_pvt_thread_mutex_unlock( &ss->ss_so->s_mutex ); return LDAP_SUCCESS; }