]> git.baikalelectronics.ru Git - kernel.git/commit
rxrpc: Fix sendmsg() returning EPIPE due to recvmsg() returning ENODATA
authorDavid Howells <dhowells@redhat.com>
Mon, 20 Jul 2020 11:41:46 +0000 (12:41 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jul 2020 00:47:10 +0000 (17:47 -0700)
commit4bd495a4a908fba565e8ca6fa9382939461dc39b
treedb0d374cdf4d772cb453f64580dcc640ec4f6885
parentb1aa5eed9b97aa77d306fe838736b0e5b10bc7e1
rxrpc: Fix sendmsg() returning EPIPE due to recvmsg() returning ENODATA

rxrpc_sendmsg() returns EPIPE if there's an outstanding error, such as if
rxrpc_recvmsg() indicating ENODATA if there's nothing for it to read.

Change rxrpc_recvmsg() to return EAGAIN instead if there's nothing to read
as this particular error doesn't get stored in ->sk_err by the networking
core.

Also change rxrpc_sendmsg() so that it doesn't fail with delayed receive
errors (there's no way for it to report which call, if any, the error was
caused by).

Fixes: 81566af9fe72 ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rxrpc/recvmsg.c
net/rxrpc/sendmsg.c