mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [MPTCP] Re: [MPTCP][PATCH mptcp-next] Squash to "mptcp: remove id 0 address"
@ 2021-03-15 22:57 Mat Martineau
  0 siblings, 0 replies; only message in thread
From: Mat Martineau @ 2021-03-15 22:57 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 912 bytes --]

On Mon, 15 Mar 2021, Geliang Tang wrote:

> Hold the msk lock when invoking mptcp_pm_remove_addr.
>
> Signed-off-by: Geliang Tang <geliangtang(a)gmail.com>
> ---
> net/mptcp/pm_netlink.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> index 037817b83f4c..b7acab673cc7 100644
> --- a/net/mptcp/pm_netlink.c
> +++ b/net/mptcp/pm_netlink.c
> @@ -1185,7 +1185,9 @@ static int mptcp_nl_remove_id_zero_address(struct net *net,
> 			goto next;
>
> 		lock_sock(sk);
> +		spin_lock_bh(&msk->pm.lock);
> 		mptcp_pm_remove_addr(msk, &list);
> +		spin_unlock_bh(&msk->pm.lock);
> 		mptcp_pm_remove_subflow(msk, &list);
> 		release_sock(sk);

The msk->pm.lock is immediately reacquired in mptcp_pm_remove_subflow - 
what about acquiring the lock once and calling 
mtpcp_pm_nl_subflow_received() directly instead?

--
Mat Martineau
Intel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-15 22:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-15 22:57 [MPTCP] Re: [MPTCP][PATCH mptcp-next] Squash to "mptcp: remove id 0 address" Mat Martineau

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).