rx: clear call_queue_lock after removing call from queue 41/13641/4
authorMark Vitale <mvitale@sinenomine.net>
Fri, 15 Mar 2019 03:15:29 +0000 (23:15 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 20 Sep 2019 03:52:15 +0000 (23:52 -0400)
The call_queue_lock is set to either rx_serverPool_lock or
rx_freeCallQueue_lock, depending on whether an rx_call resides in the
rx_incomingCallQueue or the rx_freeCallQueue, respectively.  This value
is used by rxi_ResetCall to lock the appropriate queue before removing a
call.  Therefore, the call_queue_lock should be cleared after a call is
removed from a queue.

This issue has no known external symptoms; however, repairing this is
helpful to developers examining core files.

Repair two instances where the call_queue_lock is not cleared.

Change-Id: Id1d9ac8454c1e07c10766dffb2a2beac7122bf3e
Reviewed-on: https://gerrit.openafs.org/13641
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/rx/rx.c

index b12d759..087b62d 100644 (file)
@@ -2101,6 +2101,7 @@ rx_GetCall(int tno, struct rx_service *cur_service, osi_socket * socketp)
            opr_queue_Remove(&call->entry);
            MUTEX_EXIT(&rx_serverPool_lock);
            MUTEX_ENTER(&call->lock);
+           CLEAR_CALL_QUEUE_LOCK(call);
 
            if (call->flags & RX_CALL_WAIT_PROC) {
                call->flags &= ~RX_CALL_WAIT_PROC;
@@ -2119,7 +2120,6 @@ rx_GetCall(int tno, struct rx_service *cur_service, osi_socket * socketp)
                || opr_queue_First(&call->rq, struct rx_packet, entry)->header.seq != 1)
                rxi_SendAck(call, 0, 0, RX_ACK_DELAY, 0);
 
-           CLEAR_CALL_QUEUE_LOCK(call);
            break;
        } else {
            /* If there are no eligible incoming calls, add this process
@@ -4957,6 +4957,7 @@ rxi_AttachServerProc(struct rx_call *call,
            if (opr_queue_IsOnQueue(&call->entry)) {
                opr_queue_Remove(&call->entry);
            }
+           CLEAR_CALL_QUEUE_LOCK(call);
        }
        call->state = RX_STATE_ACTIVE;
        call->app.mode = RX_MODE_RECEIVING;