a3470f
From abd66a26f1a6fb998c0b6b60c3004ea8414ffee0 Mon Sep 17 00:00:00 2001
a3470f
From: Jiffin Tony Thottan <jthottan@redhat.com>
a3470f
Date: Thu, 17 Nov 2016 12:44:38 +0530
a3470f
Subject: [PATCH 24/74] glusterd/gNFS : On post upgrade to 3.2, disable gNFS
a3470f
 for all volumes
a3470f
a3470f
Currently on 3.2 gNFS is dsiabled for newly created volumes or old volumes
a3470f
with default value. There will be volumes which have explicitly turn off
a3470f
nfs.disable option. This change disable gNFS even for that volume as well.
a3470f
a3470f
label : DOWNSTREAM ONLY
a3470f
a3470f
Change-Id: I4ddeb23690271034b0bbb3fc50b359350b5eae87
a3470f
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
a3470f
Reviewed-on: https://code.engineering.redhat.com/gerrit/90425
a3470f
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
a3470f
Tested-by: Atin Mukherjee <amukherj@redhat.com>
a3470f
---
a3470f
 xlators/mgmt/glusterd/src/glusterd-op-sm.c | 43 +++++++++++++++++-------------
a3470f
 1 file changed, 25 insertions(+), 18 deletions(-)
a3470f
a3470f
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
a3470f
index 6d5b8cf..09be165 100644
a3470f
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
a3470f
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
a3470f
@@ -2437,26 +2437,33 @@ glusterd_update_volumes_dict (glusterd_volinfo_t *volinfo)
a3470f
         GF_VALIDATE_OR_GOTO (this->name, conf, out);
a3470f
 
a3470f
         /* 3.9.0 onwards gNFS will be disabled by default. In case of an upgrade
a3470f
-         * from anything below than 3.9.0 to 3.9.x the volume's dictionary will
a3470f
-         * not have 'nfs.disable' key set which means the same will not be set
a3470f
-         * to on until explicitly done. setnfs.disable to 'on' at op-version
a3470f
-         * bump up flow is the ideal way here. The same is also applicable for
a3470f
-         * transport.address-family where if the transport type is set to tcp
a3470f
-         * then transport.address-family is defaulted to 'inet'.
a3470f
+         * from anything below than 3.9.0 to 3.9.x, the value for nfs.disable is
a3470f
+         * set to 'on' for all volumes even if it is explicitly set to 'off' in
a3470f
+         * previous version. This change is only applicable to downstream code.
a3470f
+         * Setting nfs.disable to 'on' at op-version bump up flow is the ideal
a3470f
+         * way here. The same is also applicable for transport.address-family
a3470f
+         * where if the transport type is set to tcp then transport.address-family
a3470f
+         * is defaulted to 'inet'.
a3470f
          */
a3470f
         if (conf->op_version >= GD_OP_VERSION_3_9_0) {
a3470f
-                if (dict_get_str_boolean (volinfo->dict, NFS_DISABLE_MAP_KEY,
a3470f
-                                          1)) {
a3470f
-                        ret = dict_set_dynstr_with_alloc (volinfo->dict,
a3470f
-                                                          NFS_DISABLE_MAP_KEY,
a3470f
-                                                          "on");
a3470f
-                        if (ret) {
a3470f
-                                gf_msg (this->name, GF_LOG_ERROR, errno,
a3470f
-                                        GD_MSG_DICT_SET_FAILED, "Failed to set "
a3470f
-                                        "option ' NFS_DISABLE_MAP_KEY ' on "
a3470f
-                                        "volume %s", volinfo->volname);
a3470f
-                                goto out;
a3470f
-                        }
a3470f
+                if (!(dict_get_str_boolean (volinfo->dict, NFS_DISABLE_MAP_KEY,
a3470f
+                                            0))) {
a3470f
+                        gf_msg (this->name, GF_LOG_INFO, 0, 0, "Gluster NFS is"
a3470f
+                                " being deprecated in favor of NFS-Ganesha, "
a3470f
+                                "hence setting nfs.disable to 'on' for volume "
a3470f
+                                "%s. Please re-enable it if requires",
a3470f
+                                volinfo->volname);
a3470f
+                }
a3470f
+
a3470f
+                ret = dict_set_dynstr_with_alloc (volinfo->dict,
a3470f
+                                                   NFS_DISABLE_MAP_KEY,
a3470f
+                                                   "on");
a3470f
+                if (ret) {
a3470f
+                        gf_msg (this->name, GF_LOG_ERROR, errno,
a3470f
+                                GD_MSG_DICT_SET_FAILED, "Failed to set "
a3470f
+                                "option ' NFS_DISABLE_MAP_KEY ' on "
a3470f
+                                "volume %s", volinfo->volname);
a3470f
+                        goto out;
a3470f
                 }
a3470f
                 ret = dict_get_str (volinfo->dict, "transport.address-family",
a3470f
                                     &address_family_str);
a3470f
-- 
a3470f
1.8.3.1
a3470f