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