]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
RX: rxi_PrepareSendPacket drops call lock; WaitforTQ required
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 6 Nov 2010 19:18:14 +0000 (15:18 -0400)
committerDerrick Brashear <shadow@dementia.org>
Sat, 9 Jul 2011 05:04:49 +0000 (22:04 -0700)
Since rxi_PrepareSendPacket drops the call->lock during
processing the caller must perform a rxi_WaitforTQ prior
to manipulating the transmit queue.

Reviewed-on: http://gerrit.openafs.org/3279
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit cb7a5ce44470112d3ba5e341322bb9e7d029e101)

Change-Id: I17a863d46f65fca904a22abccb849c8a8c0997ee
Reviewed-on: http://gerrit.openafs.org/4932
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/rx/rx_rdwr.c

index 90f201595915ac24a20d6927453676a6c7278435..14f7fbcccd50217fcee0164c7760535e95355948 100644 (file)
@@ -730,9 +730,6 @@ rxi_WriteProc(struct rx_call *call, char *buf,
     do {
        if (call->nFree == 0) {
            MUTEX_ENTER(&call->lock);
-#ifdef AFS_GLOBAL_RXLOCK_KERNEL
-            rxi_WaitforTQBusy(call);
-#endif /* AFS_GLOBAL_RXLOCK_KERNEL */
             cp = call->currentPacket;
             if (call->error)
                 call->mode = RX_MODE_ERROR;
@@ -753,6 +750,10 @@ rxi_WriteProc(struct rx_call *call, char *buf,
                 * conn->securityMaxTrailerSize */
                hadd32(call->bytesSent, cp->length);
                rxi_PrepareSendPacket(call, cp, 0);
+#ifdef AFS_GLOBAL_RXLOCK_KERNEL
+                /* PrepareSendPacket drops the call lock */
+                rxi_WaitforTQBusy(call);
+#endif /* AFS_GLOBAL_RXLOCK_KERNEL */
 #ifdef RX_TRACK_PACKETS
                cp->flags |= RX_PKTFLAG_TQ;
 #endif
@@ -1179,6 +1180,10 @@ rxi_WritevProc(struct rx_call *call, struct iovec *iov, int nio, int nbytes)
             * conn->securityMaxTrailerSize */
            hadd32(call->bytesSent, cp->length);
            rxi_PrepareSendPacket(call, cp, 0);
+#ifdef AFS_GLOBAL_RXLOCK_KERNEL
+            /* PrepareSendPacket drops the call lock */
+            rxi_WaitforTQBusy(call);
+#endif /* AFS_GLOBAL_RXLOCK_KERNEL */
            queue_Append(&tmpq, cp);
 #ifdef RXDEBUG_PACKET
             tmpqc++;
@@ -1358,9 +1363,6 @@ rxi_FlushWrite(struct rx_call *call)
 #endif
 
         MUTEX_ENTER(&call->lock);
-#ifdef AFS_GLOBAL_RXLOCK_KERNEL
-        rxi_WaitforTQBusy(call);
-#endif /* AFS_GLOBAL_RXLOCK_KERNEL */
         if (call->error)
             call->mode = RX_MODE_ERROR;
 
@@ -1390,6 +1392,10 @@ rxi_FlushWrite(struct rx_call *call)
        /* The 1 specifies that this is the last packet */
        hadd32(call->bytesSent, cp->length);
        rxi_PrepareSendPacket(call, cp, 1);
+#ifdef AFS_GLOBAL_RXLOCK_KERNEL
+        /* PrepareSendPacket drops the call lock */
+        rxi_WaitforTQBusy(call);
+#endif /* AFS_GLOBAL_RXLOCK_KERNEL */
 #ifdef RX_TRACK_PACKETS
        cp->flags |= RX_PKTFLAG_TQ;
 #endif