Skip to content

Commit 33b603f

Browse files
committed
rxrpc: Requeue call for recvmsg if more data
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 <[email protected]>
1 parent 91c2c7b commit 33b603f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/rxrpc/recvmsg.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,10 @@ int rxrpc_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
463463
flags, &copied);
464464
if (ret == -EAGAIN)
465465
ret = 0;
466+
467+
if (after(call->rx_top, call->rx_hard_ack) &&
468+
call->rxtx_buffer[(call->rx_hard_ack + 1) & RXRPC_RXTX_BUFF_MASK])
469+
rxrpc_notify_socket(call);
466470
break;
467471
default:
468472
ret = 0;

0 commit comments

Comments
 (0)