From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
To: mptcp@lists.linux.dev, Mat Martineau <martineau@kernel.org>,
Geliang Tang <geliang@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Jianguo Wu <wujianguo@chinatelecom.cn>,
Shuah Khan <shuah@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
zhenwei pi <pizhenwei@bytedance.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org,
"Matthieu Baerts (NGI0)" <matttbe@kernel.org>,
stable@vger.kernel.org, Geliang Tang <geliang@kernel.org>
Subject: [PATCH net 4/8] mptcp: remove duplicate sk_reset_timer call
Date: Fri, 15 Aug 2025 19:28:22 +0200 [thread overview]
Message-ID: <20250815-net-mptcp-misc-fixes-6-17-rc2-v1-4-521fe9957892@kernel.org> (raw)
In-Reply-To: <20250815-net-mptcp-misc-fixes-6-17-rc2-v1-0-521fe9957892@kernel.org>
From: Geliang Tang <tanggeliang@kylinos.cn>
sk_reset_timer() was called twice in mptcp_pm_alloc_anno_list.
Simplify the code by using a 'goto' statement to eliminate the
duplication.
Note that this is not a fix, but it will help backporting the following
patch. The same "Fixes" tag has been added for this reason.
Fixes: 93f323b9cccc ("mptcp: add a new sysctl add_addr_timeout")
Cc: stable@vger.kernel.org
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/pm.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 420d416e2603de2e54f017216c56daa80f356e87..c5f6a53ce5f1e10dada52865e41b685d888a71fa 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -353,9 +353,7 @@ bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk,
if (WARN_ON_ONCE(mptcp_pm_is_kernel(msk)))
return false;
- sk_reset_timer(sk, &add_entry->add_timer,
- jiffies + mptcp_get_add_addr_timeout(net));
- return true;
+ goto reset_timer;
}
add_entry = kmalloc(sizeof(*add_entry), GFP_ATOMIC);
@@ -369,6 +367,7 @@ bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk,
add_entry->retrans_times = 0;
timer_setup(&add_entry->add_timer, mptcp_pm_add_timer, 0);
+reset_timer:
sk_reset_timer(sk, &add_entry->add_timer,
jiffies + mptcp_get_add_addr_timeout(net));
--
2.50.0
next prev parent reply other threads:[~2025-08-15 17:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-15 17:28 [PATCH net 0/8] mptcp: misc fixes for v6.17-rc Matthieu Baerts (NGI0)
2025-08-15 17:28 ` [PATCH net 1/8] mptcp: drop skb if MPTCP skb extension allocation fails Matthieu Baerts (NGI0)
2025-08-15 17:28 ` [PATCH net 2/8] mptcp: pm: kernel: flush: do not reset ADD_ADDR limit Matthieu Baerts (NGI0)
2025-08-15 17:28 ` [PATCH net 3/8] selftests: mptcp: pm: check flush doesn't reset limits Matthieu Baerts (NGI0)
2025-08-15 17:28 ` Matthieu Baerts (NGI0) [this message]
2025-08-15 17:28 ` [PATCH net 5/8] mptcp: disable add_addr retransmission when timeout is 0 Matthieu Baerts (NGI0)
2025-08-15 17:28 ` [PATCH net 6/8] selftests: mptcp: disable add_addr retrans in endpoint_tests Matthieu Baerts (NGI0)
2025-08-15 17:28 ` [PATCH net 7/8] selftests: mptcp: connect: fix C23 extension warning Matthieu Baerts (NGI0)
2025-08-15 17:28 ` [PATCH net 8/8] selftests: mptcp: sockopt: " Matthieu Baerts (NGI0)
2025-08-16 18:27 ` [PATCH net 0/8] mptcp: misc fixes for v6.17-rc Jakub Kicinski
2025-08-17 13:50 ` Matthieu Baerts
2025-08-19 0:50 ` patchwork-bot+netdevbpf
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=20250815-net-mptcp-misc-fixes-6-17-rc2-v1-4-521fe9957892@kernel.org \
--to=matttbe@kernel.org \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=geliang@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martineau@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pizhenwei@bytedance.com \
--cc=shuah@kernel.org \
--cc=stable@vger.kernel.org \
--cc=wujianguo@chinatelecom.cn \
/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;
as well as URLs for NNTP newsgroup(s).