[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1405421569.10255.29.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Tue, 15 Jul 2014 12:52:49 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Veaceslav Falico <vfalico@...il.com>
Cc: Eric Dumazet <edumazet@...gle.com>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
Jay Vosburgh <j.vosburgh@...il.com>,
Andy Gospodarek <andy@...yhouse.net>,
Nikolay Aleksandrov <nikolay@...hat.com>,
Mahesh Bandewar <maheshb@...gle.com>
Subject: Re: [PATCH net-next 3/3] bonding: add proper __rcu annotation for
curr_active_slave
On Tue, 2014-07-15 at 12:38 +0200, Veaceslav Falico wrote:
> On Tue, Jul 15, 2014 at 02:46:44AM -0700, Eric Dumazet wrote:
> >RCU was added to bonding in linux-3.12 but lacked proper sparse annotations.
> >
> >Using __rcu annotation actually helps to spot all accesses to bond->curr_active_slave
> >are correctly protected, with LOCKDEP support.
> >
> >Signed-off-by: Eric Dumazet <edumazet@...gle.com>
>
> Thanks a lot for cleaning this up, it's really a huge mess here...
>
> One question though:
>
> ...snip...
> >@@ -2046,7 +2051,7 @@ static void bond_miimon_commit(struct bonding *bond)
> > bond_alb_handle_link_change(bond, slave,
> > BOND_LINK_DOWN);
> >
> >- if (slave == bond->curr_active_slave)
> >+ if (slave == rcu_access_pointer(bond->curr_active_slave))
>
> I guess you've meant rtnl_dereference()? As bond_miimon_commit() is ujnder
> rtnl, not under rcu.
This does not really matter here, as we only perform an equality test.
(We dont read the pointer, then dereference it)
rcu_access_pointer() is fine in this context, this makes sparse happy
mostly.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists