summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorMeghana Madhusudhan <mmadhusu@redhat.com>2015-05-05 18:19:51 +0530
committerNiels de Vos <ndevos@redhat.com>2015-05-07 01:47:13 -0700
commit6d82215ab95d95ace13465a3efd384e50942ea67 (patch)
treefc35819beaa0381060edd3fc283cb412f5d6d621 /xlators/mgmt
parent35e77e239aaa1abafe45727f76aaa61ba41cc484 (diff)
Cache-invalidation : set to on/off depending on ganesha.enable value
Multi-Head NFS-Ganesha servers need upcall (cache-invalidation) support to notify them in case of any changes to the files in the backend. Hence, upcall xlator option "features.cache-invalidation" needs to be enabled when ganesha.enable is set to 'on'. Similarly, this feature needs to be disabled when ganesha.enable is set to 'off' This is a back-port of the fix that is merged on master. http://review.gluster.org/#/c/10581/ Change-Id: I1b24c88b5a7cce963a184a0a90cee839873a8d6b BUG: 1218858 Signed-off-by: Meghana Madhusudhan <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/10594 Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> Reviewed-by: soumya k <skoduri@redhat.com> Tested-by: NetBSD Build System Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-ganesha.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
index b4375aa26c2..a200a64d7c6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
@@ -419,6 +419,7 @@ ganesha_manage_export (dict_t *dict, char *value, char **op_errstr)
int ret = -1;
char str[1024];
glusterd_volinfo_t *volinfo = NULL;
+ dict_t *vol_opts = NULL;
char *volname = NULL;
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
@@ -500,11 +501,21 @@ ganesha_manage_export (dict_t *dict, char *value, char **op_errstr)
runner_add_args (&runner, "sh", GANESHA_PREFIX"/dbus-send.sh",
CONFDIR, value, volname, NULL);
ret = runner_run (&runner);
- if (ret)
+ if (ret) {
gf_asprintf(op_errstr, "Dynamic export"
" addition/deletion failed."
" Please see log file for details");
+ goto out;
+ }
}
+ /* cache-invalidation should be on when a volume is exported
+ * and off when a volume is unexported. */
+ vol_opts = volinfo->dict;
+ ret = dict_set_dynstr_with_alloc (vol_opts,
+ "features.cache-invalidation", value);
+ if (ret)
+ gf_asprintf (op_errstr, "Cache-invalidation could not"
+ " be set to %s.", value);
out:
return ret;
}