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

Submitted by Pavel Tikhomirov on Oct. 19, 2016, 12:20 p.m.

Details

Message ID 1476879657-21581-2-git-send-email-ptikhomirov@virtuozzo.com
State New
Series "do not rely on missing rtcache in vzprivnet_hook"
Headers show

Commit Message

Pavel Tikhomirov Oct. 19, 2016, 12:20 p.m.
This reverts commit 47c285fdf54a7cd5d460702c65ffdb3a88128566.

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

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

Patch hide | download patch | download mbox

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;