kernel-ark/drivers/net/bonding
Andy Gospodarek 2439f9ebd4 bonding: fix race that causes invalid statistics
I've seen reports of invalid stats in /proc/net/dev for bonding
interfaces, and found it's a pretty easy problem to reproduce.  Since
the current code zeros the bonding stats when a read is requested and a
pointer to that data is returned to the caller we cannot guarantee that
the caller has completely accessed the data before a successive call to
request the stats zeroes the stats again.

This patch creates a new stack variable to keep track of the updated
stats and copies the data from that variable into the bonding stats
structure.  This ensures that the value for any of the bonding stats
should not incorrectly return zero for any of the bonding statistics.
This does use more stack space and require an extra memcpy, but it seems
like a fair trade-off for consistently correct bonding statistics.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Chris Snook <csnook@redhat.com>
Acked-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-03 04:28:13 -08:00
..
bond_3ad.c Convert bonding timers to workqueues 2007-10-23 20:32:00 -04:00
bond_3ad.h Convert bonding timers to workqueues 2007-10-23 20:32:00 -04:00
bond_alb.c bonding: fix locking during alb failover and slave removal 2008-01-18 14:38:38 -05:00
bond_alb.h Convert bonding timers to workqueues 2007-10-23 20:32:00 -04:00
bond_main.c bonding: fix race that causes invalid statistics 2008-02-03 04:28:13 -08:00
bond_sysfs.c bonding: fix lock ordering for rtnl and bonding_rwsem 2008-01-18 14:38:39 -05:00
bonding.h bonding: Fix up parameter parsing 2008-01-18 14:38:38 -05:00
Makefile [PATCH] bonding: add sysfs functionality to bonding (large) 2005-11-13 14:48:21 -05:00