74b1de
From 172f32058b1a7d2e42f373490853aef5dd72f02f Mon Sep 17 00:00:00 2001
d1681e
From: Jiffin Tony Thottan <jthottan@redhat.com>
d1681e
Date: Wed, 22 Feb 2017 14:20:41 +0530
74b1de
Subject: [PATCH 058/124] glusterd/ganesha : During volume delete remove the
d1681e
 ganesha export configuration file
d1681e
74b1de
Label: DOWNSTREAM ONLY
74b1de
d1681e
Change-Id: I0363e7f4d7cefd3f1b3c4f91e495767ec52e230e
d1681e
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
d1681e
Reviewed-on: https://review.gluster.org/16707
d1681e
Smoke: Gluster Build System <jenkins@build.gluster.org>
d1681e
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
d1681e
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
d1681e
Reviewed-by: soumya k <skoduri@redhat.com>
d1681e
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
d1681e
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
74b1de
Reviewed-on: https://code.engineering.redhat.com/gerrit/167143
74b1de
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
74b1de
Tested-by: RHGS Build Bot <nigelb@redhat.com>
74b1de
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
d1681e
---
d1681e
 xlators/mgmt/glusterd/src/glusterd-ganesha.c    | 2 +-
74b1de
 xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 9 +++++++++
74b1de
 2 files changed, 10 insertions(+), 1 deletion(-)
d1681e
d1681e
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
74b1de
index 81f794d..6d72fda 100644
d1681e
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
d1681e
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
74b1de
@@ -445,7 +445,7 @@ manage_export_config(char *volname, char *value, char **op_errstr)
74b1de
                     CONFDIR, value, volname, NULL);
74b1de
     ret = runner_run(&runner);
d1681e
 
74b1de
-    if (ret)
74b1de
+    if (ret && !(*op_errstr))
74b1de
         gf_asprintf(op_errstr,
74b1de
                     "Failed to create"
74b1de
                     " NFS-Ganesha export config file.");
d1681e
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
74b1de
index a0417ca..81c668c 100644
d1681e
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
d1681e
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
74b1de
@@ -2936,6 +2936,15 @@ glusterd_op_delete_volume(dict_t *dict)
74b1de
         goto out;
74b1de
     }
d1681e
 
74b1de
+    if (glusterd_check_ganesha_export(volinfo)) {
74b1de
+        ret = manage_export_config(volname, "off", NULL);
74b1de
+        if (ret)
74b1de
+            gf_msg(this->name, GF_LOG_WARNING, 0, 0,
74b1de
+                   "Could not delete ganesha export conf file "
74b1de
+                   "for %s",
74b1de
+                   volname);
74b1de
+    }
74b1de
+
74b1de
     ret = glusterd_delete_volume(volinfo);
d1681e
 out:
74b1de
     gf_msg_debug(this->name, 0, "returning %d", ret);
d1681e
-- 
d1681e
1.8.3.1
d1681e