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