diff options
author | Kevin Groeneveld <kgroeneveld@gmail.com> | 2012-07-21 02:30:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-22 15:12:32 -0400 |
commit | e3906486f616da7cc086a3ba06c0df4e5a48b4ab (patch) | |
tree | 573b6a99cf6f1e2958c59223d2e77ebe36e71ffa /drivers/net/dummy.c | |
parent | 0980e56e506b1e45022fad00bca8c8a974fda4e6 (diff) |
net: fix race condition in several drivers when reading stats
Fix race condition in several network drivers when reading stats on 32bit
UP architectures. These drivers update their stats in a BH context and
therefore should use u64_stats_fetch_begin_bh/u64_stats_fetch_retry_bh
instead of u64_stats_fetch_begin/u64_stats_fetch_retry when reading the
stats.
Signed-off-by: Kevin Groeneveld <kgroeneveld@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dummy.c')
-rw-r--r-- | drivers/net/dummy.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c index 9d6a0677466b..c260af5411d0 100644 --- a/drivers/net/dummy.c +++ b/drivers/net/dummy.c | |||
@@ -63,10 +63,10 @@ static struct rtnl_link_stats64 *dummy_get_stats64(struct net_device *dev, | |||
63 | 63 | ||
64 | dstats = per_cpu_ptr(dev->dstats, i); | 64 | dstats = per_cpu_ptr(dev->dstats, i); |
65 | do { | 65 | do { |
66 | start = u64_stats_fetch_begin(&dstats->syncp); | 66 | start = u64_stats_fetch_begin_bh(&dstats->syncp); |
67 | tbytes = dstats->tx_bytes; | 67 | tbytes = dstats->tx_bytes; |
68 | tpackets = dstats->tx_packets; | 68 | tpackets = dstats->tx_packets; |
69 | } while (u64_stats_fetch_retry(&dstats->syncp, start)); | 69 | } while (u64_stats_fetch_retry_bh(&dstats->syncp, start)); |
70 | stats->tx_bytes += tbytes; | 70 | stats->tx_bytes += tbytes; |
71 | stats->tx_packets += tpackets; | 71 | stats->tx_packets += tpackets; |
72 | } | 72 | } |