summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-ganesha.c
diff options
context:
space:
mode:
authorMeghana Madhusudhan <mmadhusu@redhat.com>2015-04-20 10:41:47 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-05-06 05:33:40 -0700
commit403a74da5d3287489829c629d42643b8b320ee62 (patch)
tree1e4a83647dee5a1fd72a496804375e1c6554aa81 /xlators/mgmt/glusterd/src/glusterd-ganesha.c
parent96871c7ddc39cdb502ebfb6d975fe8859fc3e0e9 (diff)
NFS-Ganesha : Locking global options file
Global option gluster features.ganesha enable writes into the global 'option' file. The snapshot feature also writes into the same file. To handle concurrent multiple transactions correctly, a new lock has to be introduced on this file. Every operation using this file needs to contest for the new lock type. Change-Id: Ia8a324d2a466717b39f2700599edd9f345b939a9 BUG: 1200254 Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/10130 Reviewed-by: Avra Sengupta <asengupt@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: soumya k <skoduri@redhat.com> Tested-by: NetBSD Build System Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-ganesha.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-ganesha.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
index a200a64d7c6..d4ab77ca5f9 100644
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
@@ -219,17 +219,12 @@ int
glusterd_op_set_ganesha (dict_t *dict, char **errstr)
{
int ret = 0;
- int flags = 0;
- glusterd_volinfo_t *volinfo = NULL;
- char *volname = NULL;
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
char *key = NULL;
char *value = NULL;
- char str[50] = {0, };
- int32_t dict_count = 0;
dict_t *vol_opts = NULL;
- int count = 0;
+ char *next_version = NULL;
this = THIS;
GF_ASSERT (this);
@@ -268,9 +263,17 @@ glusterd_op_set_ganesha (dict_t *dict, char **errstr)
" nfs-ganesha in dict.");
goto out;
}
-
- /* To do : Lock the global options file before writing */
- /* into this file. Bug ID : 1200254 */
+ ret = glusterd_get_next_global_opt_version_str (priv->opts,
+ &next_version);
+ if (ret) {
+ gf_log (THIS->name, GF_LOG_DEBUG, "Could not fetch "
+ " global op version");
+ goto out;
+ }
+ ret = dict_set_str (priv->opts, GLUSTERD_GLOBAL_OPT_VERSION,
+ next_version);
+ if (ret)
+ goto out;
ret = glusterd_store_options (this, priv->opts);
if (ret) {