Pārlūkot izejas kodu

ipv6: fix the use of pcpu_tstats in sit

when read/write the 64bit data, the correct lock should be hold.

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Li RongQing 11 gadi atpakaļ
vecāks
revīzija
c3ac17cd6a
1 mainītis faili ar 2 papildinājumiem un 0 dzēšanām
  1. 2 0
      net/ipv6/sit.c

+ 2 - 0
net/ipv6/sit.c

@@ -702,8 +702,10 @@ static int ipip6_rcv(struct sk_buff *skb)
 		}
 		}
 
 
 		tstats = this_cpu_ptr(tunnel->dev->tstats);
 		tstats = this_cpu_ptr(tunnel->dev->tstats);
+		u64_stats_update_begin(&tstats->syncp);
 		tstats->rx_packets++;
 		tstats->rx_packets++;
 		tstats->rx_bytes += skb->len;
 		tstats->rx_bytes += skb->len;
+		u64_stats_update_end(&tstats->syncp);
 
 
 		netif_rx(skb);
 		netif_rx(skb);