]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: Fix bonding drivers improper modification of netpoll structure
authorNeil Horman <nhorman@tuxdriver.com>
Wed, 13 Oct 2010 16:01:49 +0000 (16:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Oct 2010 15:32:07 +0000 (08:32 -0700)
commit0a9601605288ca7ee0834660de7bb16c4ac6e8e5
tree6a3adce66355ad36483500475f9931d0e359695e
parent2d99ed0908cdeb98560d0dc7612569d35b355820
bonding: Fix bonding drivers improper modification of netpoll structure

The bonding driver currently modifies the netpoll structure in its xmit path
while sending frames from netpoll.  This is racy, as other cpus can access the
netpoll structure in parallel. Since the bonding driver points np->dev to a
slave device, other cpus can inadvertently attempt to send data directly to
slave devices, leading to improper locking with the bonding master, lost frames,
and deadlocks.  This patch fixes that up.

This patch also removes the real_dev pointer from the netpoll structure as that
data is really only used by bonding in the poll_controller, and we can emulate
its behavior by check each slave for IS_UP.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c
include/linux/netpoll.h
net/core/netpoll.c