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