Message ID | 20240822101842.4234-3-pablo@netfilter.org (mailing list archive) |
---|---|
State | Accepted |
Commit | a0b39e2dc7017ac667b70bdeee5293e410fab2fb |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,1/3] netfilter: nft_counter: Disable BH in nft_counter_offload_stats(). | expand |
diff --git a/net/netfilter/nft_counter.c b/net/netfilter/nft_counter.c index 16f40b503d37..eab0dc66bee6 100644 --- a/net/netfilter/nft_counter.c +++ b/net/netfilter/nft_counter.c @@ -107,11 +107,16 @@ static void nft_counter_reset(struct nft_counter_percpu_priv *priv, struct nft_counter *total) { struct nft_counter *this_cpu; + seqcount_t *myseq; local_bh_disable(); this_cpu = this_cpu_ptr(priv->counter); + myseq = this_cpu_ptr(&nft_counter_seq); + + write_seqcount_begin(myseq); this_cpu->packets -= total->packets; this_cpu->bytes -= total->bytes; + write_seqcount_end(myseq); local_bh_enable(); }