netfilter: nf_tables: remove rcu read-size lock
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 9 Dec 2021 23:06:44 +0000 (00:06 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 23 Dec 2021 00:00:56 +0000 (01:00 +0100)
Chain stats are updated from the Netfilter hook path which already run
under rcu read-size lock section.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_core.c

index adc3480560767dfc3641823f9be6afd43c719f75..41c7509955e6a1d5872c0e12fc238cc443aa5d14 100644 (file)
@@ -110,7 +110,6 @@ static noinline void nft_update_chain_stats(const struct nft_chain *chain,
 
        base_chain = nft_base_chain(chain);
 
-       rcu_read_lock();
        pstats = READ_ONCE(base_chain->stats);
        if (pstats) {
                local_bh_disable();
@@ -121,7 +120,6 @@ static noinline void nft_update_chain_stats(const struct nft_chain *chain,
                u64_stats_update_end(&stats->syncp);
                local_bh_enable();
        }
-       rcu_read_unlock();
 }
 
 struct nft_jumpstack {