Re: [PATCH net v2] rxrpc: Fix recvmsg() unconditional requeue

From
Simon Horman <horms@kernel.org>
Date
2026-01-19 15:10:19
Also in
lkml
Reply to
David Howells, 2026-01-14
On Wed, Jan 14, 2026 at 10:03:23PM +0000, David Howells wrote:

...
quoted hunk ↗ jump to hunk
diff --git a/net/rxrpc/recvmsg.c b/net/rxrpc/recvmsg.c
...
quoted hunk ↗ jump to hunk
@@ -549,11 +550,21 @@ int rxrpc_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
 error_requeue_call:
 	if (!(flags & MSG_PEEK)) {
 		spin_lock_irq(&rx->recvmsg_lock);
-		list_add(&call->recvmsg_link, &rx->recvmsg_q);
-		spin_unlock_irq(&rx->recvmsg_lock);
-		trace_rxrpc_recvmsg(call_debug_id, rxrpc_recvmsg_requeue, 0);
+		if (list_empty(&call->recvmsg_link)) {
+			list_add(&call->recvmsg_link, &rx->recvmsg_q);
+			rxrpc_see_call(call, rxrpc_call_see_recvmsg_requeue);
+			spin_unlock_irq(&rx->recvmsg_lock);
+		} else if (list_is_first(&call->recvmsg_link, &rx->recvmsg_q)) {
+			spin_unlock_irq(&rx->recvmsg_lock);
+			rxrpc_put_call(call, rxrpc_call_see_recvmsg_requeue_first);
+		} else {
+			list_move(&call->recvmsg_link, &rx->recvmsg_q);
+			spin_unlock_irq(&rx->recvmsg_lock);
+			rxrpc_put_call(call, rxrpc_call_see_recvmsg_requeue_move);
+		}
+ 		trace_rxrpc_recvmsg(call_debug_id, rxrpc_recvmsg_requeue, 0);
Hi David,

If you need to re-spin for some other reason then please
fix the line above so only tabs are used for indentation
(a leading space seems to have sneaked in somehow).
quoted hunk ↗ jump to hunk
 	} else {
-		rxrpc_put_call(call, rxrpc_call_put_recvmsg);
+		rxrpc_put_call(call, rxrpc_call_put_recvmsg_peek_nowait);
 	}
 error_no_call:
 	release_sock(&rx->sk);
Thread (5 messages) 5 messages, 4 authors, last reply 2026-01-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help