Skip to content

Commit

Permalink
rxrpc: rxrpc_kernel_send_data() needs to handle failed call better
Browse files Browse the repository at this point in the history
If rxrpc_kernel_send_data() is asked to send data through a call that has
already failed (due to a remote abort, received protocol error or network
error), then return the associated error code saved in the call rather than
ESHUTDOWN.

This allows the caller to work out whether to ask for the abort code or not
based on this.

Signed-off-by: David Howells <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
dhowells authored and davem330 committed Mar 10, 2017
1 parent 4b3b45e commit 6fc166d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/rxrpc/sendmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,9 @@ int rxrpc_kernel_send_data(struct socket *sock, struct rxrpc_call *call,
ret = rxrpc_send_data(rxrpc_sk(sock->sk), call, msg, len);
break;
case RXRPC_CALL_COMPLETE:
/* It's too late for this call */
ret = -ESHUTDOWN;
read_lock_bh(&call->state_lock);
ret = -call->error;
read_unlock_bh(&call->state_lock);
break;
default:
/* Request phase complete for this client call */
Expand Down

0 comments on commit 6fc166d

Please sign in to comment.