From: Derrick Brashear Date: Thu, 5 Jun 2003 22:42:41 +0000 (+0000) Subject: STABLE12-rx-avoid-leaking-nwaiting-20030605 X-Git-Tag: openafs-stable-1_2_10~46 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=2165b62571318ac03f1a0e9e1d00273bb642821f;p=packages%2Fo%2Fopenafs.git STABLE12-rx-avoid-leaking-nwaiting-20030605 thanks to kolya@mit.edu for suggesting moving rather than adding the decrement and confirming sanity. basically if a call ended up call->error it was possible to queue_Remove() it, drop the call, and not rx_nWaiting--; result should be observed as rxdebug reporting waitprocs when threads were idle. (cherry picked from commit 3fd6efb40fb4b81874cd1d48a1b529a175383e55) --- diff --git a/src/rx/rx.c b/src/rx/rx.c index f59d1a677..93cdb1a56 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -1492,6 +1492,13 @@ osi_socket *socketp; MUTEX_EXIT(&rx_serverPool_lock); MUTEX_ENTER(&call->lock); + if (call->flags & RX_CALL_WAIT_PROC) { + call->flags &= ~RX_CALL_WAIT_PROC; + MUTEX_ENTER(&rx_stats_mutex); + rx_nWaiting--; + MUTEX_EXIT(&rx_stats_mutex); + } + if (call->state != RX_STATE_PRECALL || call->error) { MUTEX_EXIT(&call->lock); MUTEX_ENTER(&rx_serverPool_lock); @@ -1505,10 +1512,6 @@ osi_socket *socketp; rxi_SendAck(call, 0, 0, 0, 0, RX_ACK_DELAY, 0); CLEAR_CALL_QUEUE_LOCK(call); - call->flags &= ~RX_CALL_WAIT_PROC; - MUTEX_ENTER(&rx_stats_mutex); - rx_nWaiting--; - MUTEX_EXIT(&rx_stats_mutex); break; } else {