* [PATCH net] rxrpc: rxrpc_kernel_send_data() needs to handle failed call better
@ 2017-03-09 8:10 David Howells
2017-03-10 2:30 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2017-03-09 8:10 UTC (permalink / raw)
To: netdev; +Cc: dhowells, linux-afs, linux-kernel
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 <dhowells@redhat.com>
---
net/rxrpc/sendmsg.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c
index 47ccfeacc1c6..97ab214ca411 100644
--- a/net/rxrpc/sendmsg.c
+++ b/net/rxrpc/sendmsg.c
@@ -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 */
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-10 2:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-09 8:10 [PATCH net] rxrpc: rxrpc_kernel_send_data() needs to handle failed call better David Howells
2017-03-10 2:30 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).