summaryrefslogtreecommitdiffstats
path: root/rpc/xdr/src/glusterfs3.h
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2015-04-14 04:03:36 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-04-30 05:11:31 -0700
commit664d2d243deb132dd5daad0280ae9fa2406ca26a (patch)
treebc0bfabc3dfe20cca9ab49d47971aff6df7c77d4 /rpc/xdr/src/glusterfs3.h
parent2bf85951c6c25aa17acc591fabc3b3927b6dc82f (diff)
Upcall: Replaced opaque gfid with string in rpc cbk args
For GF_CBK_CACHE_INVALIDATION, have changed the type of gfid to be string (cannonical form) instead of opaque byte format to ensure correctness across platforms supporting different endianness. BUG: 1200262 Change-Id: Iac4372714f4b4ebcd9c4393aaf46ceba3f37f587 Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/10224 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'rpc/xdr/src/glusterfs3.h')
-rw-r--r--rpc/xdr/src/glusterfs3.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/rpc/xdr/src/glusterfs3.h b/rpc/xdr/src/glusterfs3.h
index 2acdfc7..6808064 100644
--- a/rpc/xdr/src/glusterfs3.h
+++ b/rpc/xdr/src/glusterfs3.h
@@ -273,6 +273,7 @@ gf_proto_cache_invalidation_from_upcall (gfs3_cbk_cache_invalidation_req *gf_c_r
{
struct gf_upcall_cache_invalidation *gf_c_data = NULL;
int is_cache_inval = 0;
+ int ret = -1;
GF_VALIDATE_OR_GOTO(THIS->name, gf_c_req, out);
GF_VALIDATE_OR_GOTO(THIS->name, gf_up_data, out);
@@ -284,7 +285,7 @@ gf_proto_cache_invalidation_from_upcall (gfs3_cbk_cache_invalidation_req *gf_c_r
gf_c_data = (struct gf_upcall_cache_invalidation *)gf_up_data->data;
GF_VALIDATE_OR_GOTO(THIS->name, gf_c_data, out);
- memcpy (gf_c_req->gfid, gf_up_data->gfid, 16);
+ gf_c_req->gfid = uuid_utoa (gf_up_data->gfid);
gf_c_req->event_type = gf_up_data->event_type;
gf_c_req->flags = gf_c_data->flags;
gf_c_req->expire_time_attr = gf_c_data->expire_time_attr;
@@ -298,6 +299,7 @@ gf_proto_cache_invalidation_to_upcall (gfs3_cbk_cache_invalidation_req *gf_c_req
struct gf_upcall *gf_up_data)
{
struct gf_upcall_cache_invalidation *gf_c_data = NULL;
+ int ret = -1;
GF_VALIDATE_OR_GOTO(THIS->name, gf_c_req, out);
GF_VALIDATE_OR_GOTO(THIS->name, gf_up_data, out);
@@ -305,8 +307,15 @@ gf_proto_cache_invalidation_to_upcall (gfs3_cbk_cache_invalidation_req *gf_c_req
gf_c_data = (struct gf_upcall_cache_invalidation *)gf_up_data->data;
GF_VALIDATE_OR_GOTO(THIS->name, gf_c_data, out);
- memcpy (gf_up_data->gfid, gf_c_req->gfid, 16);
- gf_up_data->event_type = gf_c_req->event_type;
+ ret = gf_uuid_parse (gf_c_req->gfid, gf_up_data->gfid);
+ if (ret) {
+ gf_log (THIS->name, GF_LOG_WARNING, "gf_uuid_parse(%s) failed",
+ gf_c_req->gfid);
+ gf_up_data->event_type = GF_UPCALL_EVENT_NULL;
+ return;
+ }
+
+ gf_up_data->event_type = gf_c_req->event_type;
gf_c_data->flags = gf_c_req->flags;
gf_c_data->expire_time_attr = gf_c_req->expire_time_attr;