diff options
Diffstat (limited to 'net/rxrpc/sendmsg.c')
-rw-r--r-- | net/rxrpc/sendmsg.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c index be01f9c5d963..46c9312085b1 100644 --- a/net/rxrpc/sendmsg.c +++ b/net/rxrpc/sendmsg.c | |||
@@ -169,10 +169,8 @@ static void rxrpc_queue_packet(struct rxrpc_sock *rx, struct rxrpc_call *call, | |||
169 | 169 | ||
170 | ASSERTCMP(seq, ==, call->tx_top + 1); | 170 | ASSERTCMP(seq, ==, call->tx_top + 1); |
171 | 171 | ||
172 | if (last) { | 172 | if (last) |
173 | annotation |= RXRPC_TX_ANNO_LAST; | 173 | annotation |= RXRPC_TX_ANNO_LAST; |
174 | set_bit(RXRPC_CALL_TX_LASTQ, &call->flags); | ||
175 | } | ||
176 | 174 | ||
177 | /* We have to set the timestamp before queueing as the retransmit | 175 | /* We have to set the timestamp before queueing as the retransmit |
178 | * algorithm can see the packet as soon as we queue it. | 176 | * algorithm can see the packet as soon as we queue it. |
@@ -386,6 +384,11 @@ static int rxrpc_send_data(struct rxrpc_sock *rx, | |||
386 | call->tx_total_len -= copy; | 384 | call->tx_total_len -= copy; |
387 | } | 385 | } |
388 | 386 | ||
387 | /* check for the far side aborting the call or a network error | ||
388 | * occurring */ | ||
389 | if (call->state == RXRPC_CALL_COMPLETE) | ||
390 | goto call_terminated; | ||
391 | |||
389 | /* add the packet to the send queue if it's now full */ | 392 | /* add the packet to the send queue if it's now full */ |
390 | if (sp->remain <= 0 || | 393 | if (sp->remain <= 0 || |
391 | (msg_data_left(msg) == 0 && !more)) { | 394 | (msg_data_left(msg) == 0 && !more)) { |
@@ -425,16 +428,6 @@ static int rxrpc_send_data(struct rxrpc_sock *rx, | |||
425 | notify_end_tx); | 428 | notify_end_tx); |
426 | skb = NULL; | 429 | skb = NULL; |
427 | } | 430 | } |
428 | |||
429 | /* Check for the far side aborting the call or a network error | ||
430 | * occurring. If this happens, save any packet that was under | ||
431 | * construction so that in the case of a network error, the | ||
432 | * call can be retried or redirected. | ||
433 | */ | ||
434 | if (call->state == RXRPC_CALL_COMPLETE) { | ||
435 | ret = call->error; | ||
436 | goto out; | ||
437 | } | ||
438 | } while (msg_data_left(msg) > 0); | 431 | } while (msg_data_left(msg) > 0); |
439 | 432 | ||
440 | success: | 433 | success: |
@@ -444,6 +437,11 @@ out: | |||
444 | _leave(" = %d", ret); | 437 | _leave(" = %d", ret); |
445 | return ret; | 438 | return ret; |
446 | 439 | ||
440 | call_terminated: | ||
441 | rxrpc_free_skb(skb, rxrpc_skb_tx_freed); | ||
442 | _leave(" = %d", call->error); | ||
443 | return call->error; | ||
444 | |||
447 | maybe_error: | 445 | maybe_error: |
448 | if (copied) | 446 | if (copied) |
449 | goto success; | 447 | goto success; |