* FAILED: patch "[PATCH] mptcp: update window_clamp on subflows when SO_RCVBUF is set" failed to apply to 7.0-stable tree
@ 2026-05-28 11:21 gregkh
2026-06-01 0:39 ` [PATCH 7.0.y] mptcp: update window_clamp on subflows when SO_RCVBUF is set Sasha Levin
0 siblings, 1 reply; 4+ messages in thread
From: gregkh @ 2026-05-28 11:21 UTC (permalink / raw)
To: yangang, matttbe, pabeni; +Cc: stable
The patch below does not apply to the 7.0-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-7.0.y
git checkout FETCH_HEAD
git cherry-pick -x 3a543ae0e2092d5c2085d5f21f7a7dbafdffea3c
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026052819-liberty-cramp-97fe@gregkh' --subject-prefix 'PATCH 7.0.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3a543ae0e2092d5c2085d5f21f7a7dbafdffea3c Mon Sep 17 00:00:00 2001
From: Gang Yan <yangang@kylinos.cn>
Date: Fri, 15 May 2026 06:27:36 +0200
Subject: [PATCH] mptcp: update window_clamp on subflows when SO_RCVBUF is set
Add __mptcp_subflow_set_rcvbuf() helper to write the subflow sk_rcvbuf,
but also to call the recently added tcp_set_rcvbuf() helper to update
window_clamp. This is needed because the window clap is updated when
scaling_ratio changes, in tcp_measure_rcv_mss(). Until scaling_ratio
changes, the subflow is stuck with the old window clamp which may be
based on a small initial buffer.
Use this new helper in both mptcp_sol_socket_sync_intval() (setsockopt
path) and sync_socket_options() (new subflow creation path).
Note that this patch depends on commit b025461303d8 ("tcp: update
window_clamp when SO_RCVBUF is set"): it fixes the issue on TCP side,
but the same fix is needed on MPTCP side as well.
Fixes: a2cbb1603943 ("tcp: Update window clamping condition")
Cc: stable@vger.kernel.org
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/619
Signed-off-by: Gang Yan <yangang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260515-net-mptcp-misc-fixes-7-1-rc4-v2-5-701e96419f2f@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
index 1cf608e7357b..87b5796d0135 100644
--- a/net/mptcp/sockopt.c
+++ b/net/mptcp/sockopt.c
@@ -67,6 +67,12 @@ static int mptcp_get_int_option(struct mptcp_sock *msk, sockptr_t optval,
return 0;
}
+static void __mptcp_subflow_set_rcvbuf(struct sock *ssk, int val)
+{
+ WRITE_ONCE(ssk->sk_rcvbuf, val);
+ tcp_set_rcvbuf(ssk, val);
+}
+
static void mptcp_sol_socket_sync_intval(struct mptcp_sock *msk, int optname, int val)
{
struct mptcp_subflow_context *subflow;
@@ -100,7 +106,7 @@ static void mptcp_sol_socket_sync_intval(struct mptcp_sock *msk, int optname, in
case SO_RCVBUF:
case SO_RCVBUFFORCE:
ssk->sk_userlocks |= SOCK_RCVBUF_LOCK;
- WRITE_ONCE(ssk->sk_rcvbuf, sk->sk_rcvbuf);
+ __mptcp_subflow_set_rcvbuf(ssk, sk->sk_rcvbuf);
break;
case SO_MARK:
if (READ_ONCE(ssk->sk_mark) != sk->sk_mark) {
@@ -1560,7 +1566,7 @@ static void sync_socket_options(struct mptcp_sock *msk, struct sock *ssk)
mptcp_subflow_ctx(ssk)->cached_sndbuf = sk->sk_sndbuf;
}
if (sk->sk_userlocks & SOCK_RCVBUF_LOCK)
- WRITE_ONCE(ssk->sk_rcvbuf, sk->sk_rcvbuf);
+ __mptcp_subflow_set_rcvbuf(ssk, sk->sk_rcvbuf);
}
if (sock_flag(sk, SOCK_LINGER)) {
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 7.0.y] mptcp: update window_clamp on subflows when SO_RCVBUF is set
2026-05-28 11:21 FAILED: patch "[PATCH] mptcp: update window_clamp on subflows when SO_RCVBUF is set" failed to apply to 7.0-stable tree gregkh
@ 2026-06-01 0:39 ` Sasha Levin
2026-06-01 0:50 ` Matthieu Baerts
0 siblings, 1 reply; 4+ messages in thread
From: Sasha Levin @ 2026-06-01 0:39 UTC (permalink / raw)
To: stable; +Cc: Gang Yan, Matthieu Baerts (NGI0), Paolo Abeni, Sasha Levin
From: Gang Yan <yangang@kylinos.cn>
[ Upstream commit 3a543ae0e2092d5c2085d5f21f7a7dbafdffea3c ]
Add __mptcp_subflow_set_rcvbuf() helper to write the subflow sk_rcvbuf,
but also to call the recently added tcp_set_rcvbuf() helper to update
window_clamp. This is needed because the window clap is updated when
scaling_ratio changes, in tcp_measure_rcv_mss(). Until scaling_ratio
changes, the subflow is stuck with the old window clamp which may be
based on a small initial buffer.
Use this new helper in both mptcp_sol_socket_sync_intval() (setsockopt
path) and sync_socket_options() (new subflow creation path).
Note that this patch depends on commit b025461303d8 ("tcp: update
window_clamp when SO_RCVBUF is set"): it fixes the issue on TCP side,
but the same fix is needed on MPTCP side as well.
Fixes: a2cbb1603943 ("tcp: Update window clamping condition")
Cc: stable@vger.kernel.org
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/619
Signed-off-by: Gang Yan <yangang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260515-net-mptcp-misc-fixes-7-1-rc4-v2-5-701e96419f2f@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ inlined missing `tcp_set_rcvbuf()` to `tcp_set_window_clamp(ssk, tcp_win_from_space(ssk, val))` ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mptcp/sockopt.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
index 1cf608e7357bd..52f4accf2bba4 100644
--- a/net/mptcp/sockopt.c
+++ b/net/mptcp/sockopt.c
@@ -67,6 +67,12 @@ static int mptcp_get_int_option(struct mptcp_sock *msk, sockptr_t optval,
return 0;
}
+static void __mptcp_subflow_set_rcvbuf(struct sock *ssk, int val)
+{
+ WRITE_ONCE(ssk->sk_rcvbuf, val);
+ tcp_set_window_clamp(ssk, tcp_win_from_space(ssk, val));
+}
+
static void mptcp_sol_socket_sync_intval(struct mptcp_sock *msk, int optname, int val)
{
struct mptcp_subflow_context *subflow;
@@ -100,7 +106,7 @@ static void mptcp_sol_socket_sync_intval(struct mptcp_sock *msk, int optname, in
case SO_RCVBUF:
case SO_RCVBUFFORCE:
ssk->sk_userlocks |= SOCK_RCVBUF_LOCK;
- WRITE_ONCE(ssk->sk_rcvbuf, sk->sk_rcvbuf);
+ __mptcp_subflow_set_rcvbuf(ssk, sk->sk_rcvbuf);
break;
case SO_MARK:
if (READ_ONCE(ssk->sk_mark) != sk->sk_mark) {
@@ -1560,7 +1566,7 @@ static void sync_socket_options(struct mptcp_sock *msk, struct sock *ssk)
mptcp_subflow_ctx(ssk)->cached_sndbuf = sk->sk_sndbuf;
}
if (sk->sk_userlocks & SOCK_RCVBUF_LOCK)
- WRITE_ONCE(ssk->sk_rcvbuf, sk->sk_rcvbuf);
+ __mptcp_subflow_set_rcvbuf(ssk, sk->sk_rcvbuf);
}
if (sock_flag(sk, SOCK_LINGER)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 7.0.y] mptcp: update window_clamp on subflows when SO_RCVBUF is set
2026-06-01 0:39 ` [PATCH 7.0.y] mptcp: update window_clamp on subflows when SO_RCVBUF is set Sasha Levin
@ 2026-06-01 0:50 ` Matthieu Baerts
2026-06-07 7:19 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Matthieu Baerts @ 2026-06-01 0:50 UTC (permalink / raw)
To: Sasha Levin; +Cc: Gang Yan, Paolo Abeni, stable
Hi Sasha,
On 01/06/2026 10:39, Sasha Levin wrote:
> From: Gang Yan <yangang@kylinos.cn>
>
> [ Upstream commit 3a543ae0e2092d5c2085d5f21f7a7dbafdffea3c ]
>
> Add __mptcp_subflow_set_rcvbuf() helper to write the subflow sk_rcvbuf,
> but also to call the recently added tcp_set_rcvbuf() helper to update
> window_clamp. This is needed because the window clap is updated when
> scaling_ratio changes, in tcp_measure_rcv_mss(). Until scaling_ratio
> changes, the subflow is stuck with the old window clamp which may be
> based on a small initial buffer.
>
> Use this new helper in both mptcp_sol_socket_sync_intval() (setsockopt
> path) and sync_socket_options() (new subflow creation path).
>
> Note that this patch depends on commit b025461303d8 ("tcp: update
> window_clamp when SO_RCVBUF is set"): it fixes the issue on TCP side,
> but the same fix is needed on MPTCP side as well.
Thank you for the backport. I guess there is a conflict, because commit
b025461303d8 ("tcp: update window_clamp when SO_RCVBUF is set") has not
been backported to 7.0 (nor 6.18, 6.12 and 6.6). See the note above for
more details.
In other words, MPTCP is imitating TCP's behaviour. So no need to
backport this patch if the fix on TCP side is not backported either.
I think it would be better to take both the TCP fix (b025461303d8), and
this one (3a543ae0e209). But maybe the TCP fix has not been backported
on purpose?
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 7.0.y] mptcp: update window_clamp on subflows when SO_RCVBUF is set
2026-06-01 0:50 ` Matthieu Baerts
@ 2026-06-07 7:19 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2026-06-07 7:19 UTC (permalink / raw)
To: Matthieu Baerts; +Cc: Sasha Levin, Gang Yan, Paolo Abeni, stable
On Mon, Jun 01, 2026 at 10:50:33AM +1000, Matthieu Baerts wrote:
> Hi Sasha,
>
> On 01/06/2026 10:39, Sasha Levin wrote:
> > From: Gang Yan <yangang@kylinos.cn>
> >
> > [ Upstream commit 3a543ae0e2092d5c2085d5f21f7a7dbafdffea3c ]
> >
> > Add __mptcp_subflow_set_rcvbuf() helper to write the subflow sk_rcvbuf,
> > but also to call the recently added tcp_set_rcvbuf() helper to update
> > window_clamp. This is needed because the window clap is updated when
> > scaling_ratio changes, in tcp_measure_rcv_mss(). Until scaling_ratio
> > changes, the subflow is stuck with the old window clamp which may be
> > based on a small initial buffer.
> >
> > Use this new helper in both mptcp_sol_socket_sync_intval() (setsockopt
> > path) and sync_socket_options() (new subflow creation path).
> >
> > Note that this patch depends on commit b025461303d8 ("tcp: update
> > window_clamp when SO_RCVBUF is set"): it fixes the issue on TCP side,
> > but the same fix is needed on MPTCP side as well.
> Thank you for the backport. I guess there is a conflict, because commit
> b025461303d8 ("tcp: update window_clamp when SO_RCVBUF is set") has not
> been backported to 7.0 (nor 6.18, 6.12 and 6.6). See the note above for
> more details.
>
> In other words, MPTCP is imitating TCP's behaviour. So no need to
> backport this patch if the fix on TCP side is not backported either.
>
> I think it would be better to take both the TCP fix (b025461303d8), and
> this one (3a543ae0e209). But maybe the TCP fix has not been backported
> on purpose?
It was not tagged for stable inclusion, so it was not applied to any
stable trees. As the tcp change isn't included, I'll just drop this one
too, thanks.
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-06-07 7:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-28 11:21 FAILED: patch "[PATCH] mptcp: update window_clamp on subflows when SO_RCVBUF is set" failed to apply to 7.0-stable tree gregkh
2026-06-01 0:39 ` [PATCH 7.0.y] mptcp: update window_clamp on subflows when SO_RCVBUF is set Sasha Levin
2026-06-01 0:50 ` Matthieu Baerts
2026-06-07 7:19 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox