From: Matthieu Baerts <matttbe@kernel.org>
To: Yuan Tan <yuantan098@gmail.com>, Kuniyuki Iwashima <kuniyu@google.com>
Cc: Ren Wei <n05ec@lzu.edu.cn>,
netdev@vger.kernel.org, mptcp@lists.linux.dev,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, ncardwell@google.com,
dsahern@kernel.org, martineau@kernel.org, geliang@kernel.org,
daniel@iogearbox.net, kafai@fb.com, yifanwucs@gmail.com,
tomapufckgml@gmail.com, bird@lzu.edu.cn, caoruide123@gmail.com,
enjou1224z@gmail.com
Subject: Re: [PATCH net 1/1] mptcp: hold subflow request owners when cloning reqsk
Date: Mon, 20 Apr 2026 10:26:02 +0200 [thread overview]
Message-ID: <54abe469-dc16-4ed7-a90e-c7ffd419d91e@kernel.org> (raw)
In-Reply-To: <05a19f8d-360e-41d1-bc8a-0b4caab3d354@gmail.com>
Hi Yuan Tan,
On 19/04/2026 11:51, Yuan Tan wrote:
>
> On 4/16/2026 11:48 AM, Kuniyuki Iwashima wrote:
>> On Thu, Apr 16, 2026 at 10:45 AM Matthieu Baerts <matttbe@kernel.org> wrote:
>>> Hi Ren,
>>>
>>> On 15/04/2026 11:31, Ren Wei wrote:
>>>> From: Ruide Cao <caoruide123@gmail.com>
>>>>
>>>> TCP request migration clones pending request sockets with
>>>> inet_reqsk_clone(). For MPTCP MP_JOIN requests this raw-copies
>>>> subflow_req->msk, but the cloned request does not take a new reference.
>>>>
>>>> Both the original and the cloned request can later drop the same msk in
>>>> subflow_req_destructor(), and a migrated request may keep a dangling msk
>>>> pointer after the original owner has already been released.
>>>>
>>>> Add a request_sock clone callback and let MPTCP grab a reference for cloned
>>>> subflow requests that carry an msk. This keeps ownership balanced across
>>>> both successful migrations and failed clone/insert paths without changing
>>>> other protocols.
(...)
>>>> diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
>>>> index e961936b6be7..140a9e96ad58 100644
>>>> --- a/net/ipv4/inet_connection_sock.c
>>>> +++ b/net/ipv4/inet_connection_sock.c
>>>> @@ -954,6 +954,9 @@ static struct request_sock *inet_reqsk_clone(struct request_sock *req,
>>>> if (sk->sk_protocol == IPPROTO_TCP && tcp_rsk(nreq)->tfo_listener)
>>>> rcu_assign_pointer(tcp_sk(nreq->sk)->fastopen_rsk, nreq);
>>> (Maybe TCP with fastopen could be this other user to call
>>> rcu_assign_pointer()? (net-next material))
>>>
>>>> + if (req->rsk_ops->init_clone)
>>>> + req->rsk_ops->init_clone(req, nreq);
>> I think a simple direct call is better.
>>
>> #ifdef CONFIG_MPTCP
>> if (tcp_rsk(req)->is_mptcp)
>> mptcp_reqsk_clone(nreq);
>> #endif
>>
> Thank you very much for your suggestion. We will use this approach in
> the next version of the patch. Would you like us to add your
> Suggested-by tag?
No need to add a Suggested-by tag: this tag is used when the whole patch
idea has been suggested by someone. That's not the case here: we only
proposed a small modification in the code, without changing the idea.
https://docs.kernel.org/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
prev parent reply other threads:[~2026-04-20 8:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1776149210.git.caoruide123@gmail.com>
2026-04-15 9:31 ` [PATCH net 1/1] mptcp: hold subflow request owners when cloning reqsk Ren Wei
2026-04-16 17:45 ` Matthieu Baerts
2026-04-16 18:48 ` Kuniyuki Iwashima
2026-04-16 21:18 ` Matthieu Baerts
2026-04-17 1:58 ` Kuniyuki Iwashima
2026-04-19 9:51 ` Yuan Tan
2026-04-20 8:26 ` Matthieu Baerts [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54abe469-dc16-4ed7-a90e-c7ffd419d91e@kernel.org \
--to=matttbe@kernel.org \
--cc=bird@lzu.edu.cn \
--cc=caoruide123@gmail.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=enjou1224z@gmail.com \
--cc=geliang@kernel.org \
--cc=horms@kernel.org \
--cc=kafai@fb.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=martineau@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=n05ec@lzu.edu.cn \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tomapufckgml@gmail.com \
--cc=yifanwucs@gmail.com \
--cc=yuantan098@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox