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

From: Simon Horman <[email-masked]>
Date: Mon, 19 Jan 2026 15:10:14 +0000

On Wed, Jan 14, 2026 at 10:03:23PM +0000, David Howells wrote:

...

> diff --git a/net/rxrpc/recvmsg.c b/net/rxrpc/recvmsg.c

...

> @@ -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).

>  	} 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);
>