e3c68b
From 1e619b95e3f03e226fef135bfaeeca9b069eb978 Mon Sep 17 00:00:00 2001
e3c68b
From: Jiffin Tony Thottan <jthottan@redhat.com>
e3c68b
Date: Wed, 14 Mar 2018 12:01:30 +0530
e3c68b
Subject: [PATCH 077/124] glusterd/ganesha : create/remove export file only
e3c68b
 from the node which performs ganesha.enable
e3c68b
e3c68b
As part of volume set ganesha.enable on the ganesha export configuration file will be created/removed
e3c68b
using "create-export-ganesha.sh". This performed from the nodes which are part of ganesha cluster.
e3c68b
But it is not need since the file is saved in shared storage and consumed by the nodes in the ganesha cluster.
e3c68b
e3c68b
Label: DOWNSTREAM ONLY
e3c68b
e3c68b
Upstream Reference :
e3c68b
>patch link : https://review.gluster.org/#/c/19716/
e3c68b
>Change-Id: I2583899972b47d451a90711940293004a3af4690
e3c68b
>BUG: 1555195
e3c68b
>Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
e3c68b
e3c68b
Change-Id: I2583899972b47d451a90711940293004a3af4690
e3c68b
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
e3c68b
Reviewed-on: https://code.engineering.redhat.com/gerrit/167162
e3c68b
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
e3c68b
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e3c68b
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
e3c68b
---
e3c68b
 xlators/mgmt/glusterd/src/glusterd-ganesha.c    | 2 +-
e3c68b
 xlators/mgmt/glusterd/src/glusterd-op-sm.c      | 3 ++-
e3c68b
 xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 2 +-
e3c68b
 3 files changed, 4 insertions(+), 3 deletions(-)
e3c68b
e3c68b
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
e3c68b
index fe0bffc..ff36476 100644
e3c68b
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
e3c68b
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
e3c68b
@@ -530,7 +530,7 @@ ganesha_manage_export(dict_t *dict, char *value,
e3c68b
      * Create the export file from the node where ganesha.enable "on"
e3c68b
      * is executed
e3c68b
      * */
e3c68b
-    if (option) {
e3c68b
+    if (option && is_origin_glusterd(dict)) {
e3c68b
         ret = manage_export_config(volname, "on", op_errstr);
e3c68b
         if (ret) {
e3c68b
             gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_EXPORT_FILE_CREATE_FAIL,
e3c68b
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
e3c68b
index 52809a8..10e2d48 100644
e3c68b
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
e3c68b
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
e3c68b
@@ -2415,7 +2415,8 @@ glusterd_op_reset_volume(dict_t *dict, char **op_rspstr)
e3c68b
     }
e3c68b
 
e3c68b
     if (!strcmp(key, "ganesha.enable") || !strcmp(key, "all")) {
e3c68b
-        if (glusterd_check_ganesha_export(volinfo)) {
e3c68b
+        if (glusterd_check_ganesha_export(volinfo) &&
e3c68b
+            is_origin_glusterd(dict)) {
e3c68b
             ret = manage_export_config(volname, "off", op_rspstr);
e3c68b
             if (ret)
e3c68b
                 gf_msg(this->name, GF_LOG_WARNING, 0, GD_MSG_NFS_GNS_RESET_FAIL,
e3c68b
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
e3c68b
index de4eccb..1ea8ba6 100644
e3c68b
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
e3c68b
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
e3c68b
@@ -2936,7 +2936,7 @@ glusterd_op_delete_volume(dict_t *dict)
e3c68b
         goto out;
e3c68b
     }
e3c68b
 
e3c68b
-    if (glusterd_check_ganesha_export(volinfo)) {
e3c68b
+    if (glusterd_check_ganesha_export(volinfo) && is_origin_glusterd(dict)) {
e3c68b
         ret = manage_export_config(volname, "off", NULL);
e3c68b
         if (ret)
e3c68b
             gf_msg(this->name, GF_LOG_WARNING, 0, 0,
e3c68b
-- 
e3c68b
1.8.3.1
e3c68b