[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1405501548.10255.51.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Wed, 16 Jul 2014 11:05:48 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Veaceslav Falico <vfalico@...il.com>
Cc: netdev@...r.kernel.org, Jay Vosburgh <j.vosburgh@...il.com>,
Andy Gospodarek <andy@...yhouse.net>
Subject: Re: [PATCH net-next] bonding: use rtnl_deref in
bond_change_rx_flags()
On Wed, 2014-07-16 at 09:24 +0200, Veaceslav Falico wrote:
> As it's always called with RTNL held, via dev_set_allmulti/promiscuity.
>
> CC: Jay Vosburgh <j.vosburgh@...il.com>
> CC: Andy Gospodarek <andy@...yhouse.net>
> Signed-off-by: Veaceslav Falico <vfalico@...il.com>
> ---
> drivers/net/bonding/bond_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index d643807..2998710 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -498,7 +498,7 @@ static int bond_set_promiscuity(struct bonding *bond, int inc)
> int err = 0;
>
> if (bond_uses_primary(bond)) {
> - struct slave *curr_active = bond_deref_active_protected(bond);
> + struct slave *curr_active = rtnl_dereference(bond->curr_active_slave);
>
> /* write lock already acquired */
This seems dubious to me. What really protects curr_active_slave being
modified ?
Considering the presence of the previous comment, I assumed the sync
point was the write lock. Not rtnl.
If write lock is never held without rtnl, then maybe the write lock is
useless, I don't know.
But after your patch its not really consistent and we increase
confusion.
> if (curr_active)
> @@ -524,7 +524,7 @@ static int bond_set_allmulti(struct bonding *bond, int inc)
> int err = 0;
>
> if (bond_uses_primary(bond)) {
> - struct slave *curr_active = bond_deref_active_protected(bond);
> + struct slave *curr_active = rtnl_dereference(bond->curr_active_slave);
>
> /* write lock already acquired */
> if (curr_active)
--
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