From: Nickolai Zeldovich Date: Mon, 21 Jan 2002 18:05:26 +0000 (+0000) Subject: rx-cleanup-deadlock-and-refcnt-leak-20020121 X-Git-Tag: openafs-devel-1_3_0~42 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=7806d0a7d5d3cc74ec692f3cd5dcc5d91c614d79;p=packages%2Fo%2Fopenafs.git rx-cleanup-deadlock-and-refcnt-leak-20020121 The first part of the patch fixes a likely deadlock in the case when we're destroying a client connection with active calls. The second part fixes a minor connection refcount leak in my recent modification to protect against half-reachable clients. --- diff --git a/src/rx/rx.c b/src/rx/rx.c index 0e5df4046..cbec10e76 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -899,7 +899,7 @@ static void rxi_DestroyConnectionNoLock(conn) RX_CALL_REFCOUNT_DELAY); if (call->state == RX_STATE_PRECALL || call->state == RX_STATE_ACTIVE) { - rxi_SendDelayedAck(call->delayedAckEvent, call, 0); + rxi_SendAck(call, 0, 0, 0, 0, RX_ACK_DELAY, 0); } else { rxi_AckAll((struct rxevent *)0, call, 0); } @@ -4285,12 +4285,15 @@ void rxi_ConnectionError(conn, error) { if (error) { register int i; + MUTEX_ENTER(&conn->conn_data_lock); if (conn->challengeEvent) rxevent_Cancel(conn->challengeEvent, (struct rx_call*)0, 0); if (conn->checkReachEvent) { rxevent_Cancel(conn->checkReachEvent, (struct rx_call*)0, 0); conn->checkReachEvent = 0; + conn->refCount--; } + MUTEX_EXIT(&conn->conn_data_lock); for (i=0; icall[i]; if (call) {