venet: destroy VE IP on venet destruction in NFS is enabled

Submitted by Stanislav Kinsburskiy on Oct. 13, 2017, 4:12 p.m.

Details

Message ID 20171013161211.19370.82241.stgit@localhost.localdomain
State New
Series "venet: destroy VE IP on venet destruction in NFS is enabled"
Headers show

Commit Message

Stanislav Kinsburskiy Oct. 13, 2017, 4:12 p.m.
We skip VE IP destruion in shutdown hook, if NFS is enabled in CT (to allow
NFS mounts to disappear.
Thus we have to destroy it with venet device.

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

Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
---
 drivers/net/venetdev.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/net/venetdev.c b/drivers/net/venetdev.c
index 7a546cc..fad232b 100644
--- a/drivers/net/venetdev.c
+++ b/drivers/net/venetdev.c
@@ -759,9 +759,12 @@  static void venet_dellink(struct net_device *dev, struct list_head *head)
 	struct ve_struct *env = dev->nd_net->owner_ve;
 
 	/* We check ve_netns to avoid races with veip SHUTDOWN hook, called from
-	 * ve_exit_ns()
+	 * ve_exit_ns().
+	 * Also, in veip SHUTDOWN hook we skip veip destructionif, if container
+	 * has VE_FEATURE_NFS enabled. Thus here we have to destroy veip in
+	 * this case.
 	 */
-	if (env->ve_netns)
+	if (env->ve_netns || (env->features & VE_FEATURE_NFS))
 		veip_shutdown(env);
 
 	env->_venet_dev = NULL;