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:40:24 +0000
commitd663b9a323f34919da3f35bfc221a0aa91d9ab94 (patch)
tree0753cdaf840826567d65cda6bfcef73510aad8fa /rpc/xdr/src/glusterfs3.h
parentce9055449477dd59f29de213d140c60b03e465eb (diff)
protocol: utilize the version 4 xdr
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 bbe2311..550b9a3 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;
}