All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang@kernel.org>, mptcp@lists.linux.dev
Cc: Geliang Tang <tanggeliang@kylinos.cn>
Subject: Re: [PATCH mptcp-next v4 6/7] mptcp: hold msk lock before removing id 0 address
Date: Thu, 23 Jan 2025 12:43:11 +0100	[thread overview]
Message-ID: <7fe39bcc-6a92-4770-8c3c-a7bffcbd72f4@kernel.org> (raw)
In-Reply-To: <b4335f327203b21ba4622b14b8a0fd8b4991692a.1737012165.git.tanggeliang@kylinos.cn>

Hi Geliang,

On 16/01/2025 08:26, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> In mptcp_pm_nl_remove_doit(), move 'lock_sock(sk)' before invoking the
> function mptcp_userspace_pm_remove_id_zero_address(). Then no need to
> hold and release this lock in this function. And 'sk' and 'err' variables
> and 'remove_err' label in it can be dropped.

Sorry, but I'm not sure to understand the reasons behind this. Is it
only to reduce a bit the number of lines? Or because you plan to re-use
the same helper elsewhere?

Please also note that, usually, helpers that can only be used under some
conditions -- e.g. while some resources are locked -- are prefixed with
two underscores. Best to do that here too then.

So if there are reasons to keep this patch (e.g. helper going to be
reused elsewhere), then I think we should rename the helper, e.g.

  __remove_id_zero_address()

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


  reply	other threads:[~2025-01-23 11:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-16  7:26 [PATCH mptcp-next v4 0/7] BPF path manager, part 3 Geliang Tang
2025-01-16  7:26 ` [PATCH mptcp-next v4 1/7] mptcp: add mptcp_pm_genl_fill_addr helper Geliang Tang
2025-01-23 11:37   ` Matthieu Baerts
2025-01-16  7:26 ` [PATCH mptcp-next v4 2/7] mptcp: add a build check for userspace_pm_dump_addr Geliang Tang
2025-01-23 11:37   ` Matthieu Baerts
2025-01-16  7:26 ` [PATCH mptcp-next v4 3/7] mptcp: add struct mptcp_pm_addr_id_bitmap Geliang Tang
2025-01-23 11:40   ` Matthieu Baerts
2025-01-16  7:26 ` [PATCH mptcp-next v4 4/7] mptcp: drop inet6_sk in mptcp_nl_find_ssk Geliang Tang
2025-01-23 11:40   ` Matthieu Baerts
2025-01-16  7:26 ` [PATCH mptcp-next v4 5/7] mptcp: drop match in userspace_pm_append_new_local_addr Geliang Tang
2025-01-23 11:41   ` Matthieu Baerts
2025-01-16  7:26 ` [PATCH mptcp-next v4 6/7] mptcp: hold msk lock before removing id 0 address Geliang Tang
2025-01-23 11:43   ` Matthieu Baerts [this message]
2025-01-16  7:26 ` [PATCH mptcp-next v4 7/7] mptcp: change is_backup interfaces as get_flags Geliang Tang
2025-01-23 11:45   ` Matthieu Baerts
2025-01-16  8:34 ` [PATCH mptcp-next v4 0/7] BPF path manager, part 3 MPTCP CI
2025-01-23 11:34 ` Matthieu Baerts

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=7fe39bcc-6a92-4770-8c3c-a7bffcbd72f4@kernel.org \
    --to=matttbe@kernel.org \
    --cc=geliang@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=tanggeliang@kylinos.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.