From: David Ahern <dsahern@kernel.org>
To: Niels Dossche <dossche.niels@gmail.com>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH v2] ipv6: acquire write lock for addr_list in dev_forward_change
Date: Mon, 21 Mar 2022 09:42:14 -0600 [thread overview]
Message-ID: <5bda97a3-6efc-4ce2-859a-be44f3c2345e@kernel.org> (raw)
In-Reply-To: <8b90b4a6-a906-0f46-bb87-0ec51c9c89fe@gmail.com>
On 3/19/22 7:17 AM, Niels Dossche wrote:
> I have an additional question about the locks on the addr_list actually.
> In addrconf_ifdown, there's a loop on addr_list within a write lock in idev->lock
>> list_for_each_entry_safe(ifa, tmp, &idev->addr_list, if_list)
> The loop body unlocks the idev->lock and reacquires it later. I assume because of the lock dependency on ifa->lock and the calls that acquire the mc_lock? Shouldn't that list iteration also be protected during the whole iteration?
>
That loop needs to be improved as well. Locking in ipv6 code is a bit
hairy.
next prev parent reply other threads:[~2022-03-21 15:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-17 15:56 [PATCH v2] ipv6: acquire write lock for addr_list in dev_forward_change Niels Dossche
2022-03-18 9:13 ` Paolo Abeni
2022-03-18 12:48 ` Paolo Abeni
2022-03-18 15:42 ` Paolo Abeni
2022-03-18 15:45 ` Niels Dossche
2022-03-18 16:50 ` Paolo Abeni
2022-03-19 13:17 ` Niels Dossche
2022-03-21 15:42 ` David Ahern [this message]
2022-03-21 18:15 ` Paolo Abeni
2022-03-21 18:28 ` Niels Dossche
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=5bda97a3-6efc-4ce2-859a-be44f3c2345e@kernel.org \
--to=dsahern@kernel.org \
--cc=davem@davemloft.net \
--cc=dossche.niels@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=yoshfuji@linux-ipv6.org \
/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).