233933
From ca3a4ebeddfef8c6909ff5388787a91ee52fd675 Mon Sep 17 00:00:00 2001
233933
From: Jiffin Tony Thottan <jthottan@redhat.com>
233933
Date: Thu, 15 Dec 2016 17:14:01 +0530
233933
Subject: [PATCH 091/124] glusterd/gNFS : explicitly set "nfs.disable" to "off"
233933
 after 3.2 upgrade
233933
233933
Gluster NFS was enabled by default for all volumes till 3.1. But 3.2 onwards
233933
for the new volumes it will be disabled by setting "nfs.disable" to "on".
233933
This take patch will take care of existing volume in such a way that if the
233933
option is not configured, it will set "nfs.disable" to "off" during op-version
233933
bump up.
233933
233933
Also this patch removes the warning message while enabling gluster NFS for
233933
a volume.
233933
233933
label : DOWNSTREAM ONLY
233933
233933
Change-Id: Ib199c3180204f917791b4627c58d846750d18a5a
233933
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
233933
Reviewed-on: https://code.engineering.redhat.com/gerrit/93146
233933
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
233933
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
233933
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
233933
Reviewed-on: https://code.engineering.redhat.com/gerrit/167574
233933
Tested-by: RHGS Build Bot <nigelb@redhat.com>
233933
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
233933
---
233933
 cli/src/cli-cmd-parser.c                   | 16 ---------------
233933
 xlators/mgmt/glusterd/src/glusterd-op-sm.c | 31 ++++++++++++------------------
233933
 2 files changed, 12 insertions(+), 35 deletions(-)
233933
233933
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
233933
index f85958b..92ceb8e 100644
233933
--- a/cli/src/cli-cmd-parser.c
233933
+++ b/cli/src/cli-cmd-parser.c
233933
@@ -1678,22 +1678,6 @@ cli_cmd_volume_set_parse(struct cli_state *state, const char **words,
233933
                 goto out;
233933
             }
233933
         }
233933
-        if ((!strcmp(key, "nfs.disable")) && (!strcmp(value, "off"))) {
233933
-            question =
233933
-                "Gluster NFS is being deprecated in favor "
233933
-                "of NFS-Ganesha Enter \"yes\" to continue "
233933
-                "using Gluster NFS";
233933
-            answer = cli_cmd_get_confirmation(state, question);
233933
-            if (GF_ANSWER_NO == answer) {
233933
-                gf_log("cli", GF_LOG_ERROR,
233933
-                       "Operation "
233933
-                       "cancelled, exiting");
233933
-                *op_errstr = gf_strdup("Aborted by user.");
233933
-                ret = -1;
233933
-                goto out;
233933
-            }
233933
-        }
233933
-
233933
         if ((strcmp(key, "cluster.brick-multiplex") == 0)) {
233933
             question =
233933
                 "Brick-multiplexing is supported only for "
233933
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
233933
index 06ea8cf..df8a6ab 100644
233933
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
233933
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
233933
@@ -2502,32 +2502,25 @@ glusterd_update_volumes_dict(glusterd_volinfo_t *volinfo)
233933
 
233933
     /* 3.9.0 onwards gNFS will be disabled by default. In case of an upgrade
233933
      * from anything below than 3.9.0 to 3.9.x, the value for nfs.disable is
233933
-     * set to 'on' for all volumes even if it is explicitly set to 'off' in
233933
+     * set to 'off' for all volumes even if it is explicitly set to 'on' in
233933
      * previous version. This change is only applicable to downstream code.
233933
-     * Setting nfs.disable to 'on' at op-version bump up flow is the ideal
233933
+     * Setting nfs.disable to 'off' at op-version bump up flow is the ideal
233933
      * way here. The same is also applicable for transport.address-family
233933
      * where if the transport type is set to tcp then transport.address-family
233933
      * is defaulted to 'inet'.
233933
      */
233933
     if (conf->op_version >= GD_OP_VERSION_3_9_0) {
233933
         if (!(dict_get_str_boolean(volinfo->dict, NFS_DISABLE_MAP_KEY, 0))) {
233933
-            gf_msg(this->name, GF_LOG_INFO, 0, 0,
233933
-                   "Gluster NFS is"
233933
-                   " being deprecated in favor of NFS-Ganesha, "
233933
-                   "hence setting nfs.disable to 'on' for volume "
233933
-                   "%s. Please re-enable it if requires",
233933
-                   volinfo->volname);
233933
-        }
233933
-
233933
-        ret = dict_set_dynstr_with_alloc(volinfo->dict, NFS_DISABLE_MAP_KEY,
233933
-                                         "on");
233933
-        if (ret) {
233933
-            gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_SET_FAILED,
233933
-                   "Failed to set "
233933
-                   "option ' NFS_DISABLE_MAP_KEY ' on "
233933
-                   "volume %s",
233933
-                   volinfo->volname);
233933
-            goto out;
233933
+            ret = dict_set_dynstr_with_alloc(volinfo->dict, NFS_DISABLE_MAP_KEY,
233933
+                                             "off");
233933
+            if (ret) {
233933
+                gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_SET_FAILED,
233933
+                       "Failed to set "
233933
+                       "option ' NFS_DISABLE_MAP_KEY ' off "
233933
+                       "volume %s",
233933
+                       volinfo->volname);
233933
+                goto out;
233933
+            }
233933
         }
233933
 
233933
         ret = dict_get_strn(volinfo->dict, "transport.address-family",
233933
-- 
233933
1.8.3.1
233933