[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250619181152.1621004-1-kuni1840@gmail.com>
Date: Thu, 19 Jun 2025 11:11:44 -0700
From: Kuniyuki Iwashima <kuni1840@...il.com>
To: pabeni@...hat.com
Cc: davem@...emloft.net,
dsahern@...nel.org,
edumazet@...gle.com,
horms@...nel.org,
kuba@...nel.org,
kuni1840@...il.com,
kuniyu@...gle.com,
netdev@...r.kernel.org
Subject: Re: [PATCH v1 net-next 02/15] ipv6: mcast: Replace locking comments with lockdep annotations.
From: Paolo Abeni <pabeni@...hat.com>
Date: Thu, 19 Jun 2025 13:56:26 +0200
> On 6/17/25 1:28 AM, Kuniyuki Iwashima wrote:
> > @@ -2072,10 +2086,7 @@ static void mld_send_report(struct inet6_dev *idev, struct ifmcaddr6 *pmc)
> > mld_sendpack(skb);
> > }
> >
> > -/*
> > - * remove zero-count source records from a source filter list
> > - * called with mc_lock
> > - */
> > +/* remove zero-count source records from a source filter list */
> > static void mld_clear_zeros(struct ip6_sf_list __rcu **ppsf, struct inet6_dev *idev)
> > {
> > struct ip6_sf_list *psf_prev, *psf_next, *psf;
> > @@ -2099,7 +2110,6 @@ static void mld_clear_zeros(struct ip6_sf_list __rcu **ppsf, struct inet6_dev *i
> > }
> > }
> >
> > -/* called with mc_lock */
> > static void mld_send_cr(struct inet6_dev *idev)
> > {
> > struct ifmcaddr6 *pmc, *pmc_prev, *pmc_next;
>
> Why are you not adding the annotation in the above 2 places? AFAICS
> mld_send_cr() is called only by mld_ifc_work(), after acquiring the
> relevant lock, and mld_clear_zeros() is only called by mld_send_cr(),
> still under the same lock.
The two functions use mc_dereference() at the entrance,
static void mld_clear_zeros(struct ip6_sf_list __rcu **ppsf, struct inet6_dev *idev)
{
struct ip6_sf_list *psf_prev, *psf_next, *psf;
psf_prev = NULL;
for (psf = mc_dereference(*ppsf, idev);
and I thought it would be redundant like
ASSERT_RTNL();
ptr = rtnl_dereference()
Powered by blists - more mailing lists