From: Andrew Deason Date: Thu, 26 Sep 2019 18:35:51 +0000 (-0500) Subject: rx: Fix test for end of call queue for LWP X-Git-Tag: upstream/1.8.6_pre1^2~38 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=dace4163c169f879c4054e1f3e9071b8b0ab3226;p=packages%2Fo%2Fopenafs.git rx: Fix test for end of call queue for LWP Commit 6ad3d646 (rx: Correctly test for end of call queue) fixed a broken end-of-queue check in rx_GetCall, but it only fixed the RX_ENABLE_LOCKS version of rx_GetCall. The non-locks version (i.e. the LWP version) still had this bug. Fix it for the LWP case, to avoid some rare cases where an Rx call can get stuck in the incoming queue. Also remove the comment added by commit 170dbb3c (rx: Use opr queues), since we're fixing the mentioned problem. Reviewed-on: https://gerrit.openafs.org/13880 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit d9fc4890f01a41fa5a63f97f2446b3afc35b473f) Change-Id: I2e0106b63a8bf09634500944490dfae2e86c18b9 Reviewed-on: https://gerrit.openafs.org/13892 Reviewed-by: Andrew Deason Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Stephan Wiesand --- diff --git a/src/rx/rx.c b/src/rx/rx.c index 8612b70d9..244838d9c 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -2219,9 +2219,8 @@ rx_GetCall(int tno, struct rx_service *cur_service, osi_socket * socketp) service = tcall->conn->service; if (QuotaOK(service)) { MUTEX_ENTER(&rx_pthread_mutex); - /* XXX - If tcall->entry.next is NULL, then we're no longer - * on a queue at all. This shouldn't happen. */ - if (tno == rxi_fcfs_thread_num || !tcall->entry.next) { + if (tno == rxi_fcfs_thread_num + || opr_queue_IsEnd(&rx_incomingCallQueue, cursor)) { 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