[Devel] [PATCH RH7 1/4] Revert "vzprivnet: rt cache drop on vzprivnet update"

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Wed Oct 19 05:20:54 PDT 2016


This reverts commit 47c285fdf54a7cd5d460702c65ffdb3a88128566.

https://jira.sw.ru/browse/PSBM-53646

Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 net/ipv4/netfilter/ip_vzprivnet.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/net/ipv4/netfilter/ip_vzprivnet.c b/net/ipv4/netfilter/ip_vzprivnet.c
index 6e2bbe2..b590b4e 100644
--- a/net/ipv4/netfilter/ip_vzprivnet.c
+++ b/net/ipv4/netfilter/ip_vzprivnet.c
@@ -489,7 +489,6 @@ static int parse_param(const char *param, int *add, u32 *net,
 static ssize_t vzpriv_write(struct file * file, const char __user *buf,
 			    size_t count, loff_t *ppos)
 {
-	struct net *net;
 	char *s, *page;
 	int err;
 	int offset;
@@ -505,6 +504,8 @@ static ssize_t vzpriv_write(struct file * file, const char __user *buf,
 	if (err)
 		goto err;
 
+	rt_cache_flush(&init_net);
+
 	s = page;
 	s[count] = 0;
 
@@ -528,11 +529,6 @@ static ssize_t vzpriv_write(struct file * file, const char __user *buf,
 		s = nextline(s);
 	}
 out:
-	rtnl_lock();
-	for_each_net(net)
-		rt_cache_flush(net);
-	rtnl_unlock();
-
 	offset = s - page;
 	if (offset > 0)
 		err = offset;
@@ -828,7 +824,6 @@ static int parse_sparse(const char *param, int *add,
 static ssize_t sparse_write(struct file * file, const char __user *buf,
 			    size_t count, loff_t *ppos)
 {
-	struct net *net;
 	char *s, *page;
 	int err;
 	int offset;
@@ -844,6 +839,8 @@ static ssize_t sparse_write(struct file * file, const char __user *buf,
 	if (err)
 		goto err;
 
+	rt_cache_flush(&init_net);
+
 	s = page;
 	s[count] = 0;
 
@@ -868,11 +865,6 @@ static ssize_t sparse_write(struct file * file, const char __user *buf,
 		s = nextline(s);
 	}
 out:
-	rtnl_lock();
-	for_each_net(net)
-		rt_cache_flush(net);
-	rtnl_unlock();
-
 	offset = s - page;
 	if (offset > 0)
 		err = offset;
-- 
2.7.4



More information about the Devel mailing list