From 35d48903e9781975e823b359ee85c257c9ff5c1c Mon Sep 17 00:00:00 2001 From: Jiri Pirko Date: Tue, 22 Mar 2011 02:38:12 +0000 Subject: bonding: fix rx_handler locking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prevents possible race between bond_enslave and bond_handle_frame as reported by Nicolas by moving rx_handler register/unregister. slave->bond is added to hold pointer to master bonding sructure. That way dev->master is no longer used in bond_handler_frame. Also, this removes "BUG: scheduling while atomic" message Reported-by: Nicolas de Pesloüan Signed-off-by: Jiri Pirko Signed-off-by: Andy Gospodarek Tested-by: Nicolas de Pesloüan Signed-off-by: David S. Miller --- drivers/net/bonding/bonding.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/bonding/bonding.h') diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 6b26962fd0ec..90736cb4d975 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h @@ -187,6 +187,7 @@ struct slave { struct net_device *dev; /* first - useful for panic debug */ struct slave *next; struct slave *prev; + struct bonding *bond; /* our master */ int delay; unsigned long jiffies; unsigned long last_arp_rx; -- cgit v1.2.3