From d663b9a323f34919da3f35bfc221a0aa91d9ab94 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 18 Jan 2018 10:31:38 +0530 Subject: protocol: utilize the version 4 xdr updates #384 Change-Id: Id80bf470988dbecc69779de9eb64088559cb1f6a Signed-off-by: Amar Tumballi --- rpc/xdr/src/glusterfs3.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'rpc/xdr/src/glusterfs3.h') diff --git a/rpc/xdr/src/glusterfs3.h b/rpc/xdr/src/glusterfs3.h index bbe231139b3..550b9a3ceb8 100644 --- a/rpc/xdr/src/glusterfs3.h +++ b/rpc/xdr/src/glusterfs3.h @@ -668,6 +668,9 @@ dict_to_xdr (dict_t *this, gfx_dict *dict) goto out; } + /* Do the whole operation in locked region */ + LOCK (&this->lock); + dict->pairs.pairs_val = GF_CALLOC (1, (this->count * sizeof (gfx_dict_pair)), gf_common_mt_char); @@ -756,6 +759,10 @@ dict_to_xdr (dict_t *this, gfx_dict *dict) ret = 0; out: + /* this can be null here, so unlock only if its not null */ + if (this) + UNLOCK (&this->lock); + return ret; } -- cgit