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>
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;
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;
}
/* 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;
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;
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,