Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796115601; b=0zKLkkQDXDTvRDsSo59kDlLNVo2Aen3SrSY52C3MW4Xd+mp9SYjbbIksSbzlJXyw1yBZ oLm8QLhPHUoq6mJPPVcuyDFXVvK8nfkUedHEUxusZSCU2NJNiMIXGnPB/r0TPUh1GSCGF XScP6ceaOrJzb+EZF2puvSbfm/iZFkYG7mXVYb+ve2jT/G6WIyWc23zvga0Ci54wVbbry tIrP/AItUwhWRzDgm7cJP0A5notrLO57Bj5Kab3vNGFX5kXzHQcjTbVIRxFQbpdj91XUA 3HbpYRzlphV9CNkOvxNp7Voxn1XCBn+S6ow/LGXkLgtuQnyYkoGJS9/+vty2i3IVdnw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796115601; h=Received:DKIM-Signature:Message-ID:Subject:From:To:Cc:Date: In-Reply-To:References:Content-Type:User-Agent:MIME-Version: Content-Transfer-Encoding; bh=n8b03G50rxlBfO8IuI6N2L7g0WpiIIziwq0pwwKfiV8=; b=KC0t0iak7/DIbf0YiTOJRzEkkOdpUofMoa31q02xNbz3oVzbVtfRwvodRtzy+Lt5EuFq eraSmgZOCAKvbVwjYpFugR1psqYKXQzxb34XbRNg8ekmSeJW5mhXw79oEQ3L1B7Pxl2Wk bsLELHVvt58d+d6VEfoTKmHAsweW3V7/KlnzQy/9rf6PbIIXxiO8nmJUMnW6Sim4fEZ1v Oics3HEHTXUWtPmiG6hXyAsZfOMd0hBgKIytFqa5o1mvO+xVGz2ewfpDDKAo1/YKyzmvD QM7S0q/LuDi7nx4qJmkYNVkgtLoXWB8UC9oc4O38XueHNHFv6hJ4YXz5NBF7bxUg0cQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hdLCc52w; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 669C8606A329 for ; Tue, 1 Dec 2026 09:00:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hdLCc52w Received: by smtp.kernel.org (Postfix) with ESMTPSA id 644AC1F00893; Tue, 1 Dec 2026 08:59:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796115601; bh=n8b03G50rxlBfO8IuI6N2L7g0WpiIIziwq0pwwKfiV8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=hdLCc52wR4KFD/ZYAr9OndD4Avd8x5keHRdU5Bgk5W7AlxUrki2fvVgKkOB5wWGaS FOn1wD82lmYndc5zRHlYoTqMFNKf4ewxTelBF/LDjNmhW85Zx0psbEDgLmAOqbiU3/ Zv2OpTUzbHzlJb5AwLNOGEGaxfjazzWLUOJ9inXMDjRqYtCfhpl5foQAzj1Y9bjznY 1unDPvghQR6rWTuzy+xv6iCFMDwUjEG9iB+YhUHedCWiLnqzxyDo2qE/3IubXxVTFl owGZMNq3GVfP4gZi2ox/ozUPYeOAMNpPjIJR3BPcQPyBy3t1EY5xj3iC1LWu3tB60x 2BGNZHtzFPPJg== Message-ID: Subject: Re: [PATCH mptcp-net v3 11/50] mptcp: no sf left: process pending MP_FASTCLOSE From: Geliang Tang To: Matthieu Baerts Cc: MPTCP Linux Date: Tue, 01 Dec 2026 16:59:56 +0800 In-Reply-To: References: <20261124-mptcp-cmason-fixes-v3-0-416c0920c73f@kernel.org> <20261124-mptcp-cmason-fixes-v3-11-416c0920c73f@kernel.org> <6f9057868b35286ebf0e487787b5b0e15f1582c6.camel@kernel.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.56.2-10build1 X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Hi Matt, On Fri, 2026-11-27 at 19:57 +0100, Matthieu Baerts wrote: > Hi Geliang, > > Thank you for the review! > > On 27/11/2026 02:12, Geliang Tang wrote: > > Hi Matt, > > > > On Tue, 2026-11-24 at 22:59 +0100, Matthieu Baerts (NGI0) wrote: > > > When the last subflow is closed while the MPTCP socket is no longer in > > > the ESTABLISHED state, e.g. in CLOSE_WAIT after a DATA_FIN, the MPTCP > > > socket moves to TCP_CLOSE. But this subflow could have been closed by a > > > reset carrying an MP_FASTCLOSE, not processed yet: if this reset is > > > received while the worker is running, after mptcp_check_fastclose(), and > > > before __mptcp_close_subflow(). At the next run of the worker, the MPTCP > > > socket being closed, the MP_FASTCLOSE is ignored, and no error is > > > reported. > > > > > > This issue has been observed with the "fastclose test" subtest from > > > mptcp_join.sh: after the DATA_FIN from the client, then its > > > MP_FASTCLOSE, the server, still having data to send, was killed after > > > the timeout: > > > > > > [FAIL] client exit code 0, server 143 > > > > > > Since commit "mptcp: wake up blocked senders when no sf left", this > > > subtest no longer fails: SEND_SHUTDOWN is set in this case, and the > > > server gets EPIPE when writing, which is expected there. But the reset > > > is still not reported. This has been confirmed with a debug patch > > > keeping the worker busy until the subflow is closed, and Packetdrill > > > scripts sending an MP_FASTCLOSE in this window: in CLOSE_WAIT, SO_ERROR > > > was 0 instead of EPIPE, and poll() did not report EPOLLERR; in > > > FIN_WAIT2, read() returned ENOTCONN instead of ECONNRESET: > > > > > > fastclose_close_wait_race_err.pkt:26: runtime error in getsockopt call: Bad getsockopt optval: expected: 32 actual: 0 > > > fastclose_fin_wait2_race_read.pkt:28: runtime error in read call: Expected errno 104 (Connection reset by peer) but got 107 (Transport endpoint is not connected) > > > > > > To fix this, process a pending MP_FASTCLOSE before the close, if the > > > socket is still in use. > > > > > > Fixes: 27e5ccc2d5a5 ("mptcp: fix dangling connection hang-up") > > > Signed-off-by: Matthieu Baerts (NGI0) > > > --- > > > v2: new, for an issue causing a flaky selftest > > > v3: msg: the subtest no longer fails since patch 7, and the remaining > > > issue, checked with Packetdrill (Clashiko) > > > --- > > > net/mptcp/protocol.c | 5 +++++ > > > 1 file changed, 5 insertions(+) > > > > > > diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c > > > index 5d916c6b43f4..bcdad00d3573 100644 > > > --- a/net/mptcp/protocol.c > > > +++ b/net/mptcp/protocol.c > > > @@ -2705,6 +2705,8 @@ static void mptcp_cleanup_ssk_backlog(struct sock *sk, struct sock *ssk) > > > mptcp_data_unlock(sk); > > > } > > > > > > +static void mptcp_check_fastclose(struct mptcp_sock *msk); > > > + > > > > Would it be more appropriate to move the definition of mptcp_check_rcv_close() > > helper from patch 12 into this patch? > > It's a good idea, but I prefer not to do that for net and keep the patch > as small as possible. The patch 11/50 can be backported up to v5.10: > better to keep it small. While the next one is for v6.19 (so only > backported to v7.3). I agree. Reviewed-by: Geliang Tang Thanks, -Geliang > > Cheers, > Matt