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