mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Mat Martineau <mathew.j.martineau at linux.intel.com>
To: mptcp at lists.01.org
Subject: [MPTCP] Re: [MPTCP][PATCH mptcp-next] Squash to "mptcp: remove id 0 address"
Date: Mon, 15 Mar 2021 15:57:58 -0700	[thread overview]
Message-ID: <74a84231-1880-90ed-776-ba3d1eadcd2e@linux.intel.com> (raw)
In-Reply-To: c91a096b410d3e05d1b8d8057e7dbc4555fee3b9.1615808638.git.geliangtang@gmail.com

[-- 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

                 reply	other threads:[~2021-03-15 22:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=74a84231-1880-90ed-776-ba3d1eadcd2e@linux.intel.com \
    --to=mptcp@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;
as well as URLs for NNTP newsgroup(s).