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