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