Skip to content

Commit

Permalink
rxrpc: Requeue call for recvmsg if more data
Browse files Browse the repository at this point in the history
rxrpc_recvmsg() needs to make sure that the call it has just been
processing gets requeued for further attention if the buffer has been
filled and there's more data to be consumed.  The softirq producer only
queues the call and wakes the socket if it fills the first slot in the
window, so userspace might end up sleeping forever otherwise, despite there
being data available.

This is not a problem provided the userspace buffer is big enough or it
empties the buffer completely before more data comes in.

Signed-off-by: David Howells <dhowells@redhat.com>
  • Loading branch information
David Howells committed Sep 13, 2016
1 parent 91c2c7b commit 33b603f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/rxrpc/recvmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ int rxrpc_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
flags, &copied);
if (ret == -EAGAIN)
ret = 0;

if (after(call->rx_top, call->rx_hard_ack) &&
call->rxtx_buffer[(call->rx_hard_ack + 1) & RXRPC_RXTX_BUFF_MASK])
rxrpc_notify_socket(call);
break;
default:
ret = 0;
Expand Down

0 comments on commit 33b603f

Please sign in to comment.