summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2015-12-16 05:45:03 -0500
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-05-19 02:28:07 -0700
commit8facd588f20ef8305b6f6b53da0f6d54d300093b (patch)
tree066a5c1d7f7bf4c56685be859ca5c256e4d8c1e8 /xlators/protocol
parent005d18a623dc49397e2a83a7fb80607ae0a9aed9 (diff)
upcall: pass dict with xattrs on xattr invalidation
In case of xattr invalidation, return a dict containing the updated xattrs. [ndevos: move chunks to change 12995 and only address the xattrs-dict here] Change-Id: I8733f06a519a9a0f24be1bb4b2c38c9c9dce0ce2 BUG: 1211863 Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/12996 Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: soumya k <skoduri@redhat.com> Tested-by: soumya k <skoduri@redhat.com>
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/client/src/client-callback.c12
-rw-r--r--xlators/protocol/server/src/server.c9
2 files changed, 16 insertions, 5 deletions
diff --git a/xlators/protocol/client/src/client-callback.c b/xlators/protocol/client/src/client-callback.c
index 4935ef5de7c..bedc8f6ec2b 100644
--- a/xlators/protocol/client/src/client-callback.c
+++ b/xlators/protocol/client/src/client-callback.c
@@ -103,10 +103,13 @@ client_cbk_cache_invalidation (struct rpc_clnt *rpc, void *mydata, void *data)
}
upcall_data.data = &ca_data;
- gf_proto_cache_invalidation_to_upcall (&ca_req, &upcall_data);
+ ret = gf_proto_cache_invalidation_to_upcall (THIS, &ca_req,
+ &upcall_data);
+ if (ret < 0)
+ goto out;
- gf_msg_trace (THIS->name, 0, "Upcall gfid = %s, ret = %d",
- ca_req.gfid, ret);
+ gf_msg_trace (THIS->name, 0, "Cache invalidation cbk recieved for gfid:"
+ " %s, ret = %d", ca_req.gfid, ret);
default_notify (THIS, GF_EVENT_UPCALL, &upcall_data);
@@ -117,6 +120,9 @@ out:
if (ca_req.xdata.xdata_val)
free (ca_req.xdata.xdata_val);
+ if (ca_data.dict)
+ dict_unref (ca_data.dict);
+
return 0;
}
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index 99874acae72..0e8b28899bc 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -1200,8 +1200,10 @@ server_process_event_upcall (xlator_t *this, void *data)
switch (upcall_data->event_type) {
case GF_UPCALL_CACHE_INVALIDATION:
- gf_proto_cache_invalidation_from_upcall (&gf_c_req,
- upcall_data);
+ ret = gf_proto_cache_invalidation_from_upcall (this, &gf_c_req,
+ upcall_data);
+ if (ret < 0)
+ goto out;
up_req = &gf_c_req;
cbk_procnum = GF_CBK_CACHE_INVALIDATION;
@@ -1243,6 +1245,9 @@ server_process_event_upcall (xlator_t *this, void *data)
pthread_mutex_unlock (&conf->mutex);
ret = 0;
out:
+ if ((gf_c_req.xdata).xdata_val)
+ GF_FREE ((gf_c_req.xdata).xdata_val);
+
return ret;
}