From: Paolo Abeni Date: Fri, 21 Nov 2025 17:02:07 +0000 (+0100) Subject: mptcp: do not miss early first subflow close event notification X-Git-Tag: v6.19-rc1~170^2~85^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=48a395605e088e1365bcc0b94e53746537c21969;p=thirdparty%2Fkernel%2Flinux.git mptcp: do not miss early first subflow close event notification The MPTCP protocol is not currently emitting the NL event when the first subflow is closed before msk accept() time. By replacing the in use close helper is such scenario, implicitly introduce the missing notification. Note that in such scenario we want to be sure that mptcp_close_ssk() will not trigger any PM work, move the msk state change update earlier, so that the previous patch will offer such guarantee. Signed-off-by: Paolo Abeni Reviewed-by: Geliang Tang Tested-by: Geliang Tang Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20251121-net-next-mptcp-memcg-backlog-imp-v1-8-1f34b6c1e0b1@kernel.org Signed-off-by: Jakub Kicinski --- diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index df4be41ed3fe1..2ee76c8c5167e 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -4052,10 +4052,10 @@ static int mptcp_stream_accept(struct socket *sock, struct socket *newsock, * deal with bad peers not doing a complete shutdown. */ if (unlikely(inet_sk_state_load(msk->first) == TCP_CLOSE)) { - __mptcp_close_ssk(newsk, msk->first, - mptcp_subflow_ctx(msk->first), 0); if (unlikely(list_is_singular(&msk->conn_list))) mptcp_set_state(newsk, TCP_CLOSE); + mptcp_close_ssk(newsk, msk->first, + mptcp_subflow_ctx(msk->first)); } } else { tcpfallback: