diff options
Diffstat (limited to 'xlators/protocol')
-rw-r--r-- | xlators/protocol/client/src/client-callback.c | 12 | ||||
-rw-r--r-- | xlators/protocol/server/src/server.c | 9 |
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; } |