rx: pass serial number to rxi_SendRawAbort 31/12931/3
authorJeffrey Altman <jaltman@auristor.com>
Fri, 23 Feb 2018 23:26:24 +0000 (18:26 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Sat, 14 Apr 2018 01:39:00 +0000 (21:39 -0400)
The practice of stamping abort packets with the connection's next
serial number was altered by a0ae8f514519b73ba7f7653bb78b9fc5b6e228f8.

This change restores the prior behavior by passing a serial number
as a parameter to rxi_SendRawAbort() so that the serial number can
be obtained from the connection instead of hard coded as 1.

Change-Id: I0fb516b2c596e675fa4bc44598a697de81d36d83
Reviewed-on: https://gerrit.openafs.org/12931
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/rx/rx.c
src/rx/rx_packet.c
src/rx/rx_prototypes.h

index c7742fa..698be10 100644 (file)
@@ -3165,10 +3165,15 @@ static_inline int
 rxi_AbortIfServerBusy(osi_socket socket, struct rx_connection *conn,
                      struct rx_packet *np)
 {
+    afs_uint32 serial;
+
     if ((rx_BusyThreshold > 0) &&
        (rx_atomic_read(&rx_nWaiting) > rx_BusyThreshold)) {
+       MUTEX_ENTER(&conn->conn_data_lock);
+       serial = ++conn->serial;
+       MUTEX_EXIT(&conn->conn_data_lock);
        rxi_SendRawAbort(socket, conn->peer->host, conn->peer->port,
-                        rx_BusyError, np, 0);
+                        serial, rx_BusyError, np, 0);
        if (rx_stats_active)
            rx_atomic_inc(&rx_stats.nBusies);
        return 1;
@@ -3420,7 +3425,7 @@ rxi_ReceivePacket(struct rx_packet *np, osi_socket socket,
        don't abort an abort. */
     if (!conn) {
         if (unknownService && (np->header.type != RX_PACKET_TYPE_ABORT))
-            rxi_SendRawAbort(socket, host, port, RX_INVALID_OPERATION,
+           rxi_SendRawAbort(socket, host, port, 1, RX_INVALID_OPERATION,
                              np, 0);
         return np;
     }
index 214f307..7c95515 100644 (file)
@@ -2552,7 +2552,8 @@ rxi_SendPacketList(struct rx_call *call, struct rx_connection *conn,
 /* Send a raw abort packet, without any call or connection structures */
 void
 rxi_SendRawAbort(osi_socket socket, afs_uint32 host, u_short port,
-                afs_int32 error, struct rx_packet *source, int istack)
+                afs_uint32 serial, afs_int32 error,
+                struct rx_packet *source, int istack)
 {
     struct rx_header theader;
     struct sockaddr_in addr;
@@ -2561,7 +2562,7 @@ rxi_SendRawAbort(osi_socket socket, afs_uint32 host, u_short port,
     memset(&theader, 0, sizeof(theader));
     theader.epoch = htonl(source->header.epoch);
     theader.callNumber = htonl(source->header.callNumber);
-    theader.serial = htonl(1);
+    theader.serial = htonl(serial);
     theader.type = RX_PACKET_TYPE_ABORT;
     theader.serviceId = htons(source->header.serviceId);
     theader.securityIndex = source->header.securityIndex;
index 8af5308..0af7ba8 100644 (file)
@@ -426,8 +426,8 @@ extern void rxi_SendPacketList(struct rx_call *call,
                               struct rx_connection *conn,
                               struct rx_packet **list, int len, int istack);
 extern void rxi_SendRawAbort(osi_socket socket, afs_uint32 host, u_short port,
-                            afs_int32 error, struct rx_packet *source,
-                            int istack);
+                            afs_uint32 serial, afs_int32 error,
+                            struct rx_packet *source, int istack);
 extern struct rx_packet *rxi_SendSpecial(struct rx_call *call,
                                         struct rx_connection *conn,
                                         struct rx_packet *optionalPacket,