[RHEL7,COMMIT] venet: destroy VE IP on venet destruction in NFS is enabled

Submitted by Konstantin Khorenko on Oct. 17, 2017, 4:30 p.m.


Message ID 201710171630.v9HGUesi027427@finist_ce7.work
State New
Series "venet: destroy VE IP on venet destruction in NFS is enabled"
Headers show

Commit Message

Konstantin Khorenko Oct. 17, 2017, 4:30 p.m.
The commit is pushed to "branch-rh7-3.10.0-693.1.1.vz7.37.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.1.1.vz7.37.15
commit 4dee6ba7f64e055d5d7ab88a6333c303729db672
Author: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Date:   Tue Oct 17 19:30:40 2017 +0300

    venet: destroy VE IP on venet destruction in NFS is enabled
    We skip VE IP destruction in shutdown hook, if NFS is enabled in CT
    (to allow NFS mounts to disappear).
    Thus we have to destroy it along with venet device.
    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..0adc1fd 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 destruction, 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))
 	env->_venet_dev = NULL;