]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
rx: Correctly test for end of call queue
authorMarc Dionne <marc.c.dionne@gmail.com>
Wed, 18 Jan 2012 01:19:54 +0000 (20:19 -0500)
committerDerrick Brashear <shadow@dementix.org>
Mon, 23 Jan 2012 15:26:04 +0000 (07:26 -0800)
The intention of this condition is to check if the current call
being considered is the last one on the queue, but the test is
incorrect.  A null next pointer indicates a removed item, not
the end of the queue.

Use the queue_IsLast macro instead to correctly determine that
this is the last item in the queue and that a call has to be
selected, either the current one or a previously seen good choice.

This can cause calls to get permanently stuck in the call queue
and never get assigned to a thread, even when all threads are
idle.

Reviewed-on: http://gerrit.openafs.org/6564
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 6ad3d646e62801cb81a3c9efeac320daa44936e1)

Change-Id: Ic9d0ff51c79115960ebb4634fc35a5e9da21c380
Reviewed-on: http://gerrit.openafs.org/6570
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/rx/rx.c

index ffb9a364b1b224e3cc667c895326d48c6eae95e8..918be8c1ab70e6e126c8fb43d31d6a3c93afc40b 100644 (file)
@@ -2004,7 +2004,7 @@ rx_GetCall(int tno, struct rx_service *cur_service, osi_socket * socketp)
                }
                MUTEX_ENTER(&rx_pthread_mutex);
                if (tno == rxi_fcfs_thread_num
-                   || !tcall->queue_item_header.next) {
+                       || queue_IsLast(&rx_incomingCallQueue, tcall)) {
                    MUTEX_EXIT(&rx_pthread_mutex);
                    /* If we're the fcfs thread , then  we'll just use
                     * this call. If we haven't been able to find an optimal