[PATCH net-next 5/8] mptcp: remove unneeded mptcp_move_skb()

From: Matthieu Baerts (NGI0)

Date: Sat Sep 27 2025 - 05:41:13 EST


From: Paolo Abeni <pabeni@xxxxxxxxxx>

Since commit b7535cfed223 ("mptcp: drop legacy code around RX EOF"),
sk_shutdown can't change during the main recvmsg loop, we can drop
the related race breaker.

Reviewed-by: Geliang Tang <geliang@xxxxxxxxxx>
Tested-by: Geliang Tang <geliang@xxxxxxxxxx>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@xxxxxxxxxx>
Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@xxxxxxxxxx>
---
net/mptcp/protocol.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 832782e23740d22acda608966c29516666c9b111..26fbd9f6a3f7802c428e79c7f4e1da45aa9533e5 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2207,14 +2207,8 @@ static int mptcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
break;
}

- if (sk->sk_shutdown & RCV_SHUTDOWN) {
- /* race breaker: the shutdown could be after the
- * previous receive queue check
- */
- if (__mptcp_move_skbs(sk))
- continue;
+ if (sk->sk_shutdown & RCV_SHUTDOWN)
break;
- }

if (sk->sk_state == TCP_CLOSE) {
copied = -ENOTCONN;

--
2.51.0