Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1595781 > unrolled thread

[PATCH net] rxrpc: rxrpc_kernel_send_data() needs to handle failed call better

Started byDavid Howells <dhowells@redhat.com>
First post2017-03-09 09:20 +0100
Last post2017-03-10 03:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH net] rxrpc: rxrpc_kernel_send_data() needs to handle failed  call better David Howells <dhowells@redhat.com> - 2017-03-09 09:20 +0100
    Re: [PATCH net] rxrpc: rxrpc_kernel_send_data() needs to handle  failed call better David Miller <davem@davemloft.net> - 2017-03-10 03:40 +0100

#1595781 — [PATCH net] rxrpc: rxrpc_kernel_send_data() needs to handle failed call better

FromDavid Howells <dhowells@redhat.com>
Date2017-03-09 09:20 +0100
Subject[PATCH net] rxrpc: rxrpc_kernel_send_data() needs to handle failed call better
Message-ID<tj1sK-2tF-7@gated-at.bofh.it>
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 */

[toc] | [next] | [standalone]


#1596575 — Re: [PATCH net] rxrpc: rxrpc_kernel_send_data() needs to handle failed call better

FromDavid Miller <davem@davemloft.net>
Date2017-03-10 03:40 +0100
SubjectRe: [PATCH net] rxrpc: rxrpc_kernel_send_data() needs to handle failed call better
Message-ID<tjiDf-5vT-11@gated-at.bofh.it>
In reply to#1595781
From: David Howells <dhowells@redhat.com>
Date: Thu, 09 Mar 2017 08:10:32 +0000

> 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>

Applied, thanks David.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web