Skip to content

Commit

Permalink
rxrpc: Fix Tx ring annotation after initial Tx failure
Browse files Browse the repository at this point in the history
rxrpc calls have a ring of packets that are awaiting ACK or retransmission
and a parallel ring of annotations that tracks the state of those packets.
If the initial transmission of a packet on the underlying UDP socket fails
then the packet annotation is marked for resend - but the setting of this
mark accidentally erases the last-packet mark also stored in the same
annotation slot.  If this happens, a call won't switch out of the Tx phase
when all the packets have been transmitted.

Fix this by retaining the last-packet mark and only altering the packet
state.

Fixes: 248f219 ("rxrpc: Rewrite the data and ack handling code")
Signed-off-by: David Howells <dhowells@redhat.com>
  • Loading branch information
David Howells committed Mar 30, 2018
1 parent f82eb88 commit 03877bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/rxrpc/sendmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ static inline void rxrpc_instant_resend(struct rxrpc_call *call, int ix)
spin_lock_bh(&call->lock);

if (call->state < RXRPC_CALL_COMPLETE) {
call->rxtx_annotations[ix] = RXRPC_TX_ANNO_RETRANS;
call->rxtx_annotations[ix] =
(call->rxtx_annotations[ix] & RXRPC_TX_ANNO_LAST) |
RXRPC_TX_ANNO_RETRANS;
if (!test_and_set_bit(RXRPC_CALL_EV_RESEND, &call->events))
rxrpc_queue_call(call);
}
Expand Down

0 comments on commit 03877bf

Please sign in to comment.