From: sashiko-bot@kernel.org
To: "Gang Yan" <gang.yan@linux.dev>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v6 5/6] Squash-to "mptcp: pm: init and release mptcp_pm_ops"
Date: Fri, 04 Sep 2026 09:50:04 +0000 [thread overview]
Message-ID: <20260904095005.34CA31F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260904093531.20023-6-gang.yan@linux.dev>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Contradictory claim in the commit message regarding module unloading.
--
commit 954ec9b5378fa18a4b6badb35d44bfbe2edbd12a
Author: Gang Yan <yangang@kylinos.cn>
Squash-to "mptcp: pm: init and release mptcp_pm_ops"
This commit introduces mptcp_pm_ops lifetime handling on sockets and per-net
path managers. It modifies path manager initialization and cleanup routines
to use operations structs directly and take module references.
> This commit introduces the mptcp_pm_ops lifetime handling on sockets
> (mptcp_pm_ops_init/release taking a module reference), and would then
> be the first one whose per-net path managers can be unloaded while a
> pernet still stores them.
[ ... ]
> diff --git a/net/mptcp/ctrl.c b/net/mptcp/ctrl.c
> index 87491b961bf27..6379a9f481ac6 100644
> --- a/net/mptcp/ctrl.c
> +++ b/net/mptcp/ctrl.c
[ ... ]
> @@ -224,15 +222,22 @@ static int proc_blackhole_detect_timeout(const struct ctl_table *table,
>
> static int mptcp_set_path_manager(struct mptcp_pernet *pernet, const char *name)
> {
> - struct mptcp_pm_ops *pm_ops;
> + struct mptcp_pm_ops *pm_ops, *prev;
> int ret = 0;
>
> rcu_read_lock();
> pm_ops = mptcp_pm_find(name);
> - if (pm_ops)
> - xchg(&pernet->path_manager, pm_ops);
> - else
> + if (pm_ops) {
> + if (bpf_try_module_get(pm_ops, pm_ops->owner)) {
> + prev = xchg(&pernet->path_manager, pm_ops);
[Severity: Medium]
Does this code contradict the commit message regarding module unloading?
The commit message claims that per-net path managers "can be unloaded while a
pernet still stores them." However, here in mptcp_set_path_manager() (as well
as in mptcp_pernet_set_defaults()), bpf_try_module_get() is explicitly called
before storing the pm_ops pointer in the per-net structure.
This increments the module's reference count, which fundamentally prevents the
module from being unloaded (e.g., via rmmod) as long as the netns uses it.
Could the commit message or the implementation be clarified to resolve this
mismatch?
> + if (prev)
> + bpf_module_put(prev, prev->owner);
> + } else {
> + ret = -EBUSY;
> + }
> + } else {
> ret = -ENOENT;
> + }
> rcu_read_unlock();
>
> return ret;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260904093531.20023-1-gang.yan@linux.dev?part=5
next prev parent reply other threads:[~2026-09-04 9:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 9:35 [PATCH mptcp-next v6 0/6] mptcp: avoid data-races around the sysctls Gang Yan
2026-09-04 9:35 ` [PATCH mptcp-next v6 1/6] mptcp: sched: change scheduler sysctl atomically Gang Yan
2026-09-04 9:35 ` [PATCH mptcp-next v6 2/6] mptcp: pm: change path_manager " Gang Yan
2026-09-04 9:35 ` [PATCH mptcp-next v6 3/6] mptcp: use READ_ONCE() over sysctls Gang Yan
2026-09-04 9:35 ` [PATCH mptcp-next v6 4/6] mptcp: pm: use WRITE_ONCE() for the pm_type sysctl Gang Yan
2026-09-04 9:35 ` [PATCH mptcp-next v6 5/6] Squash-to "mptcp: pm: init and release mptcp_pm_ops" Gang Yan
2026-09-04 9:50 ` sashiko-bot [this message]
2026-09-04 9:35 ` [PATCH mptcp-next v6 6/6] Squash to previous one Gang Yan
2026-09-04 9:51 ` sashiko-bot
2026-09-10 11:14 ` gang.yan
2026-09-04 10:45 ` [PATCH mptcp-next v6 0/6] mptcp: avoid data-races around the sysctls MPTCP CI
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=20260904095005.34CA31F00A3D@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=gang.yan@linux.dev \
--cc=mptcp@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
/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