OpenAFS Master Repository branch, master, updated. openafs-devel-1_5_76-2407-g660720d

Gerrit Code Review
Mon, 16 Apr 2012 08:47:47 -0700 (PDT)

The following commit has been merged in the master branch:
commit 660720d1f54a867e21f78b6ec4c024235e4c37b7
Author: Andrew Deason <>
Date:   Thu Mar 29 10:30:47 2012 -0500

    rx: dec rx_nWaiting on clearing RX_CALL_WAIT_PROC
    Currently, a couple of callers (rxi_ResetCall, and
    rxi_AttachServerProc) will decrement rx_nWaiting only if
    RX_CALL_WAIT_PROC is set for a call, and the call is on a queue
    (presumably rx_incomingCallQueue). This can cause an imbalance in
    rx_nWaiting if these code paths are reached when, in another thread,
    rx_GetCall has removed the call from its queue, but it has not yet
    cleared RX_CALL_WAIT_PROC (this can happen while it is waiting for
    call->lock). In this situation, rx_GetCall will remove the call from
    its queue, wait, and e.g. rxi_ResetCall will clear RX_CALL_WAIT_PROC;
    neither will decrement rx_nWaiting.
    This is possible if a new call is started on a call channel with an
    extant call that is waiting for a thread; we will rxi_ResetCall in
    rxi_ReceivePacket, but rx_GetCall may be running at the same time.
    This race may also be possible via rxi_AttachServerProc via
    rxi_UpdatePeerReach -> TryAttach -> rxi_AttachServerProc while
    rx_GetCall is running, but I'm not sure.
    To avoid this, decrement rx_nWaiting based on RX_CALL_WAIT_PROC alone,
    regardless of whether or not the call is on a queue. This mirrors the
    incrementing rx_nWaiting behavior, where rx_nWaiting is only
    incremented if RX_CALL_WAIT_PROC is unset for a call, so this should
    guarantee that rx_nWaiting does not become unbalanced.
    Change-Id: I7dba4ba5f7cc33270c2d0f486b850fc0391927d1
    Reviewed-by: Alistair Ferguson <>
    Reviewed-by: Derrick Brashear <>
    Reviewed-by: Jeffrey Altman <>
    Tested-by: BuildBot <>

 src/rx/rx.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

OpenAFS Master Repository