[Devel] [PATCH RHEL7 COMMIT] ve/net: Do not initialize netns_ct::can_alloc twice

Konstantin Khorenko khorenko at virtuozzo.com
Mon Dec 5 01:51:00 PST 2016


The commit is pushed to "branch-rh7-3.10.0-327.36.1.vz7.20.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.36.1.vz7.20.10
------>
commit 5270ea02fcd0e9dd5a9f7b4908eef3b7f3ee11ea
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Mon Dec 5 13:51:00 2016 +0400

    ve/net: Do not initialize netns_ct::can_alloc twice
    
    It's already initialized to zero during net creation
    in net_alloc(), so do not do that twice.
    
    Also, some conntrack allowing modules do not depend
    on nf_conntrack.ko, so it rewrites can_alloc to zero,
    if it's loaded later.
    
    (This may be merged with "commit af2b974e4755 "net: Primitives to enable conntrack allocation")
    
    https://jira.sw.ru/browse/PSBM-56500
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 include/net/netns/conntrack.h     | 2 +-
 net/netfilter/nf_conntrack_core.c | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
index 0c2a685..31596df 100644
--- a/include/net/netns/conntrack.h
+++ b/include/net/netns/conntrack.h
@@ -74,7 +74,7 @@ struct ct_pcpu {
 
 struct netns_ct {
 	atomic_t		count;
-	bool			can_alloc;
+	bool			can_alloc; /* Initialized in 0 by net_alloc */
 	unsigned int		max;
 	unsigned int		expect_count;
 	unsigned int		expect_max;
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index d5a283a..8fca77e 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -1823,7 +1823,6 @@ int nf_conntrack_init_net(struct net *net)
 	int cpu;
 
 	atomic_set(&net->ct.count, 0);
-	net->ct.can_alloc = false;
 	net->ct.max = init_net.ct.max;
 	seqcount_init(&net->ct.generation);
 


More information about the Devel mailing list