Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1466a219 authored by Jay Vosburgh's avatar Jay Vosburgh Committed by Jeff Garzik
Browse files

bonding: fix rtnl locking merge error



	Looks like I incorrectly merged one of the rtnl lock changes,
so that one function, bonding_show_active_slave, held rtnl but didn't
release it, and another, bonding_store_active_slave, never held rtnl but
did release it.

	Fixed so the first function doesn't mess with rtnl, and the
second correctly acquires and releases rtnl.

	Bug reported by Moni Shoua <monis@voltaire.com>

Signed-off-by: default avatarJay Vosburgh <fubar@us.ibm.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent a5e68c02
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1193,8 +1193,6 @@ static ssize_t bonding_show_active_slave(struct device *d,
	struct bonding *bond = to_bond(d);
	int count;

	rtnl_lock();

	read_lock(&bond->curr_slave_lock);
	curr = bond->curr_active_slave;
	read_unlock(&bond->curr_slave_lock);
@@ -1216,7 +1214,9 @@ static ssize_t bonding_store_active_slave(struct device *d,
        struct slave *new_active = NULL;
	struct bonding *bond = to_bond(d);

	rtnl_lock();
	write_lock_bh(&bond->lock);

	if (!USES_PRIMARY(bond->params.mode)) {
		printk(KERN_INFO DRV_NAME
		       ": %s: Unable to change active slave; %s is in mode %d\n",