lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 31 Jul 2013 11:56:57 -0700
From:	Stephen Hemminger <stephen@...workplumber.org>
To:	Nikolay Aleksandrov <nikolay@...hat.com>
Cc:	netdev@...r.kernel.org, andy@...yhouse.net, davem@...emloft.net,
	fubar@...ibm.com
Subject: Re: [PATCH net-next 1/5] bonding: convert to list API and replace
 bond's custom list

On Wed, 31 Jul 2013 20:44:49 +0200
Nikolay Aleksandrov <nikolay@...hat.com> wrote:

> On 07/31/2013 08:37 PM, Stephen Hemminger wrote:
> > On Wed, 31 Jul 2013 17:12:29 +0200
> > Nikolay Aleksandrov <nikolay@...hat.com> wrote:
> > 
> >> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
> >> index 390061d..80e288c 100644
> >> --- a/drivers/net/bonding/bond_3ad.c
> >> +++ b/drivers/net/bonding/bond_3ad.c
> >> @@ -143,10 +143,13 @@ static inline struct bonding *__get_bond_by_port(struct port *port)
> >>   */
> >>  static inline struct port *__get_first_port(struct bonding *bond)
> >>  {
> >> +	struct slave *first_slave;
> >> +
> >>  	if (bond->slave_cnt == 0)
> >>  		return NULL;
> >> +	first_slave = bond_first_slave(bond);
> > 
> > As Jay said, it would be be better to have bond_first_slave return
> > NULL (if no slaves), and eliminate slave_cnt. It would also fix
> > a race here between slave_cnt and all slave's being removed.
> > 
> Hi Stephen,
> First off - thank you for the review.
> 
> What do you mean by eliminate slave_cnt ?
> We need it for various calculations throughout the bonding.
> There's no race here because read_lock(&bond->lock) is held every time this
> is called and slave_cnt can change only under write_lock of the same lock,
> the 3ad code is not yet converted to RCU.
> 
> Nik

I would hope the goal would be to eliminate all read_lock's and allow
it to be totally RCU based.

You could then reduce slave_cnt to being only accessed by under a spin_lock
when doing management actions.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ