OpenAFS Master Repository branch, openafs-devel-1_7_x, updated. openafs-devel-1_7_9-38-g20bb041

Gerrit Code Review gerrit@openafs.org
Mon, 16 Apr 2012 10:28:23 -0700 (PDT)


The following commit has been merged in the openafs-devel-1_7_x branch:
commit 9c3125e94a5d95ec560327cc217491681db24556
Author: Andrew Deason <adeason@sinenomine.net>
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.
    
    Reviewed-on: http://gerrit.openafs.org/6986
    Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
    Reviewed-by: Derrick Brashear <shadow@dementix.org>
    Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    (cherry picked from commit 660720d1f54a867e21f78b6ec4c024235e4c37b7)
    
    Change-Id: I374190636ca97e29c4743d9a42eb3f1e68c264a5
    Reviewed-on: http://gerrit.openafs.org/7221
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

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

-- 
OpenAFS Master Repository