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

Submitted by Konstantin Khorenko on Dec. 5, 2016, 9:51 a.m.

Details

Message ID 201612050951.uB59p0Tf020053@finist_cl7.x64_64.work.ct
State New
Series "net: Do not initialize netns_ct::can_alloc"
Headers show

Commit Message

Konstantin Khorenko Dec. 5, 2016, 9:51 a.m.
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@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@virtuozzo.com>
---
 include/net/netns/conntrack.h     | 2 +-
 net/netfilter/nf_conntrack_core.c | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

Patch hide | download patch | download mbox

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);