d1681e
From 80810495522f2e0f484c2b593d66318e34bfabb9 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
d1681e
Subject: [PATCH 197/201] 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
d1681e
Label: BACKPORT FROM UPSTREAM 3.10
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
BUG: 1551186
d1681e
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
d1681e
Reviewed-on: https://code.engineering.redhat.com/gerrit/133592
d1681e
Tested-by: RHGS Build Bot <nigelb@redhat.com>
d1681e
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
d1681e
---
d1681e
 xlators/mgmt/glusterd/src/glusterd-ganesha.c    | 2 +-
d1681e
 xlators/mgmt/glusterd/src/glusterd-op-sm.c      | 2 +-
d1681e
 xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 2 +-
d1681e
 3 files changed, 3 insertions(+), 3 deletions(-)
d1681e
d1681e
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
d1681e
index 7ba25ee..b130d5e 100644
d1681e
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
d1681e
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
d1681e
@@ -543,7 +543,7 @@ ganesha_manage_export (dict_t *dict, char *value,
d1681e
          * Create the export file from the node where ganesha.enable "on"
d1681e
          * is executed
d1681e
          * */
d1681e
-         if (option) {
d1681e
+         if (option && is_origin_glusterd (dict)) {
d1681e
                 ret  = manage_export_config (volname, "on", op_errstr);
d1681e
                 if (ret) {
d1681e
                         gf_msg (this->name, GF_LOG_ERROR, 0,
d1681e
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
d1681e
index 0a21e02..a02a0b3 100644
d1681e
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
d1681e
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
d1681e
@@ -2364,7 +2364,7 @@ glusterd_op_reset_volume (dict_t *dict, char **op_rspstr)
d1681e
         }
d1681e
 
d1681e
         if (!strcmp(key, "ganesha.enable") || !strcmp (key, "all")) {
d1681e
-                if (glusterd_check_ganesha_export (volinfo)) {
d1681e
+                if (glusterd_check_ganesha_export (volinfo) && is_origin_glusterd (dict)) {
d1681e
                         ret = manage_export_config (volname, "off", op_rspstr);
d1681e
                         if (ret)
d1681e
                                 gf_msg (this->name, GF_LOG_WARNING, 0,
d1681e
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
d1681e
index 414f9ba..e34d58a 100644
d1681e
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
d1681e
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
d1681e
@@ -2858,7 +2858,7 @@ glusterd_op_delete_volume (dict_t *dict)
d1681e
                         volname);
d1681e
                 goto out;
d1681e
         }
d1681e
-        if (glusterd_check_ganesha_export (volinfo)) {
d1681e
+        if (glusterd_check_ganesha_export (volinfo) && is_origin_glusterd (dict)) {
d1681e
                 ret = manage_export_config (volname, "off", NULL);
d1681e
                 if (ret)
d1681e
                         gf_msg (this->name, GF_LOG_WARNING, 0, 0,
d1681e
-- 
d1681e
1.8.3.1
d1681e