From 403a74da5d3287489829c629d42643b8b320ee62 Mon Sep 17 00:00:00 2001 From: Meghana Madhusudhan Date: Mon, 20 Apr 2015 10:41:47 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/10130 Reviewed-by: Avra Sengupta Tested-by: Gluster Build System Reviewed-by: soumya k Tested-by: NetBSD Build System Reviewed-by: Kaleb KEITHLEY --- cli/src/cli-cmd-parser.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'cli/src/cli-cmd-parser.c') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index d70f6ee1e30..5437b38d3a6 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -903,6 +903,20 @@ cli_cmd_ganesha_parse (struct cli_state *state, goto out; } + ret = dict_set_str (dict, "globalname", "All"); + if (ret) { + gf_log (THIS->name, GF_LOG_ERROR, "dict set on global" + " key failed."); + goto out; + } + + ret = dict_set_int32 (dict, "hold_global_locks", _gf_true); + if (ret) { + gf_log (THIS->name, GF_LOG_ERROR, "dict set on global key " + "failed."); + goto out; + } + *options = dict; out: if (ret) @@ -4373,6 +4387,17 @@ cli_snap_config_limit_parse (const char **words, dict_t *dict, goto out; } + ret = dict_set_dynstr_with_alloc (dict, "globalname", "All"); + if (ret) { + gf_log ("cli", GF_LOG_ERROR, "Could not set global key"); + goto out; + } + ret = dict_set_int32 (dict, "hold_global_locks", _gf_true); + if (ret) { + gf_log ("cli", GF_LOG_ERROR, "Could not set global locks"); + goto out; + } + out: return ret; } -- cgit