summaryrefslogtreecommitdiffstats
path: root/rpc/xdr/src/glusterfs3.h
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2018-01-18 10:31:38 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2018-02-01 11:41:00 +0000
commit4c74d7ffb61d5e1d747e60ee51937126edd6ba54 (patch)
tree4f0c768a7da934ca86dfa65e17c32a87a6b6f141 /rpc/xdr/src/glusterfs3.h
parent14555df7c6bc74622eb2283ded1c1f10980180ce (diff)
protocol: utilize the version 4 xdrv4.0.0rc0
updates #384 Change-Id: Id80bf470988dbecc69779de9eb64088559cb1f6a Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'rpc/xdr/src/glusterfs3.h')
-rw-r--r--rpc/xdr/src/glusterfs3.h7
1 files changed, 7 insertions, 0 deletions
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;
}