lists.openwall.net   lists  /  announce  john-users  owl-users  popa3d-users  /  xvendor  oss-security  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4 
Open Source and information security mailing list archives
 
Order Openwall GNU/*/Linux 2.0 on a CD with delivery worldwide
[<prev] [next>] [<thread-prev] [thread-next>] [month] [year] [list]
Date:	Mon, 2 Jun 2008 13:47:03 +0300 (IDT)
From:	Or Gerlitz <ogerlitz@...taire.com>
To:	Jay Vosburgh <fubar@...ibm.com>
Subject: [RFC v2 PATCH 3/3] net/bonding: deliver netdev event for fail-over
 under the active-backup mode

under active-backup mode and when there's actual new_active slave, have bond_change_active_slave()
call the networking core to deliver NETDEV_BONDING_FAILOVER event such that the fail-over can
be notable by code outside of the bonding driver such as the RDMA stack and monitoring tools.

As the correct context of locking appropriate for notifier calls is RTNL and nothing else,
bond->curr_slave_lock and bond->lock are unlocked and later locked again. This is ensured
by the rest of the code to be safe under backup-mode AND when new_active is not NULL.

Signed-off-by: Or Gerlitz <ogerlitz@...taire.com>

- changes from v1
 * set correct locking context for the notifier call
 * with these unlockings I don't see any more the "scheduling while atomic" warnings

---
 drivers/net/bonding/bond_main.c |    6 ++++++
 1 file changed, 6 insertions(+)

Index: netdev-2.6/drivers/net/bonding/bond_main.c
===================================================================
--- netdev-2.6.orig/drivers/net/bonding/bond_main.c	2008-06-02 11:55:32.000000000 +0300
+++ netdev-2.6/drivers/net/bonding/bond_main.c	2008-06-02 11:56:07.000000000 +0300
@@ -1201,6 +1201,12 @@ void bond_change_active_slave(struct bon
 			} else
 				dprintk("delaying gratuitous arp on %s\n",
 					bond->curr_active_slave->dev->name);
+
+			write_unlock_bh(&bond->curr_slave_lock);
+			read_unlock(&bond->lock);
+			netdev_bonding_change(bond->dev)
+			read_lock(&bond->lock);
+			write_lock_bh(&bond->curr_slave_lock);
 		}
 	}
 }
--
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

Hosted by DataForce ISP - Powered by Openwall GNU/*/Linux