diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 99b01e32915..a55265f763f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -3997,6 +3997,9 @@ glusterd_import_friend_volume (dict_t *peer_data, size_t count) glusterd_volinfo_t *old_volinfo = NULL; glusterd_volinfo_t *new_volinfo = NULL; glusterd_svc_t *svc = NULL; + gf_boolean_t newexportvalue; + gf_boolean_t oldexportvalue; + char *value = NULL; GF_ASSERT (peer_data); @@ -4017,7 +4020,9 @@ glusterd_import_friend_volume (dict_t *peer_data, size_t count) ret = glusterd_volinfo_find (new_volinfo->volname, &old_volinfo); if (0 == ret) { - (void) gd_check_and_update_rebalance_info (old_volinfo, + oldexportvalue = glusterd_check_ganesha_export (old_volinfo); + + (void) gd_check_and_update_rebalance_info (old_volinfo, new_volinfo); /* Copy brick ports from the old volinfo always. The old_volinfo @@ -4038,6 +4043,31 @@ glusterd_import_friend_volume (dict_t *peer_data, size_t count) } } + ret = glusterd_volinfo_get (new_volinfo, "ganesha.enable", &value); + if (ret) + goto out; + ret = gf_string2boolean (value, &newexportvalue); + if (ret) + goto out; + + /* * + * if new and old export value is off, then there is no point in calling + * ganesha_manage_export + */ + if (!((newexportvalue == oldexportvalue) && + newexportvalue == _gf_false)) { + ret = ganesha_manage_export (new_volinfo->volname, value, + NULL, _gf_true); + if (ret) { + gf_msg (this->name, GF_LOG_ERROR, 0, + GD_MSG_NFS_GNS_OP_HANDLE_FAIL, + "Returning from ganesha_manage_export with" + " ret: %d for volume %s ganesha.enable %s", + ret, new_volinfo->volname, + value); + goto out; + } + } ret = glusterd_store_volinfo (new_volinfo, GLUSTERD_VOLINFO_VER_AC_NONE); if (ret) { gf_msg (this->name, GF_LOG_ERROR, 0, |