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