Commit 6fc166d6 authored by David Howells's avatar David Howells Committed by David S. Miller

rxrpc: rxrpc_kernel_send_data() needs to handle failed call better

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: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4b3b45ed
...@@ -618,8 +618,9 @@ int rxrpc_kernel_send_data(struct socket *sock, struct rxrpc_call *call, ...@@ -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); ret = rxrpc_send_data(rxrpc_sk(sock->sk), call, msg, len);
break; break;
case RXRPC_CALL_COMPLETE: case RXRPC_CALL_COMPLETE:
/* It's too late for this call */ read_lock_bh(&call->state_lock);
ret = -ESHUTDOWN; ret = -call->error;
read_unlock_bh(&call->state_lock);
break; break;
default: default:
/* Request phase complete for this client call */ /* Request phase complete for this client call */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment