diff options
author | Meghana Madhusudhan <mmadhusu@redhat.com> | 2015-04-20 10:41:47 +0530 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2015-05-07 02:08:43 -0700 |
commit | 4aad69a8f88acf384c812316aaa985cde2229cd7 (patch) | |
tree | 12318360918c95e89f7a40a24855e626cae0a014 /cli | |
parent | 6d82215ab95d95ace13465a3efd384e50942ea67 (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.
This is a back-port of the patch,
http://review.gluster.org/#/c/10130/
Change-Id: I1fdd285814e615a13dbf8c88ad2b7ee311247f90
BUG: 1218963
Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com>
Reviewed-on: http://review.gluster.org/10606
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: NetBSD Build System
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-cmd-parser.c | 25 | ||||
-rw-r--r-- | cli/src/cli-rpc-ops.c | 4 |
2 files changed, 27 insertions, 2 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index d4aa61ca6b8..4fd205ed5fe 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) @@ -4240,6 +4254,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; } diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 07fb8dc7e67..3c32e6d8a09 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -1870,9 +1870,9 @@ gf_cli_ganesha_cbk (struct rpc_req *req, struct iovec *iov, if (rsp.op_ret) { if (strcmp (rsp.op_errstr, "")) - cli_err ("ganesha enable: failed: %s", rsp.op_errstr); + cli_err ("nfs-ganesha: failed: %s", rsp.op_errstr); else - cli_err ("ganesha enable: failed"); + cli_err ("nfs-ganesha: failed"); } else { |