You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
David S. Miller
parent
0980e56e50
commit
e3906486f6
@@ -107,10 +107,10 @@ static struct rtnl_link_stats64 *loopback_get_stats64(struct net_device *dev,
|
||||
|
||||
lb_stats = per_cpu_ptr(dev->lstats, i);
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&lb_stats->syncp);
|
||||
start = u64_stats_fetch_begin_bh(&lb_stats->syncp);
|
||||
tbytes = lb_stats->bytes;
|
||||
tpackets = lb_stats->packets;
|
||||
} while (u64_stats_fetch_retry(&lb_stats->syncp, start));
|
||||
} while (u64_stats_fetch_retry_bh(&lb_stats->syncp, start));
|
||||
bytes += tbytes;
|
||||
packets += tpackets;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user