]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
rx-lock-leak-20051128
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 29 Nov 2005 07:00:19 +0000 (07:00 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 29 Nov 2005 07:00:19 +0000 (07:00 +0000)
Fix a lock leak introduced when adding thread local packet queues.

src/rx/rx.c

index b8fdec8d1b9542403cc825b05d6bfe27d4e85d59..a324150c8d392a49f965d4783e667417ff101307 100644 (file)
@@ -2855,11 +2855,15 @@ rxi_ReceivePacket(register struct rx_packet *np, osi_socket socket,
        np = rxi_ReceiveAckPacket(call, np, 1);
        break;
     case RX_PACKET_TYPE_ABORT:
-       /* An abort packet: reset the connection, passing the error up to
-        * the user */
+       /* An abort packet: reset the call, passing the error up to the user. */
        /* What if error is zero? */
+       /* What if the error is -1? the application will treat it as a timeout. */
        rxi_CallError(call, ntohl(*(afs_int32 *) rx_DataOf(np)));
-       break;
+       MUTEX_EXIT(&call->lock);
+       MUTEX_ENTER(&conn->conn_data_lock);
+       conn->refCount--;
+       MUTEX_EXIT(&conn->conn_data_lock);
+       return np;              /* xmitting; drop packet */
     case RX_PACKET_TYPE_BUSY:
        /* XXXX */
        break;
@@ -2881,7 +2885,10 @@ rxi_ReceivePacket(register struct rx_packet *np, osi_socket socket,
            rxi_SetAcksInTransmitQueue(call);
            break;
 #else /* RX_ENABLE_LOCKS */
+           MUTEX_EXIT(&call->lock);
+           MUTEX_ENTER(&conn->conn_data_lock);
            conn->refCount--;
+           MUTEX_EXIT(&conn->conn_data_lock);
            return np;          /* xmitting; drop packet */
 #endif /* RX_ENABLE_LOCKS */
        }