summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2019-03-05 08:39:16 +0530
committerAmar Tumballi <amarts@redhat.com>2019-03-07 10:39:21 +0000
commit8fb4631c65f28dd0a5e0304386efff3c807e64a4 (patch)
tree14e012b60a89d245b61959bf75a0e67e7cc77de1
parentc691b4a373506dd2e197d2803c67e9c55bddff2e (diff)
dict: handle STR_OLD data type in xdr conversions
Currently a dict conversion on wire for 3.x protocol happens using `dict_unserialize()`, which sets the type of data as STR_OLD. But the new protocol doesn't send it over the wire as its not considered as a valid format in new processes. But considering we deal with old and new protocol when we do a rolling upgrade, it will allow us to get all the information properly with new protocol. Credits: Krutika Dhananjay Fixes: bz#1684385 Change-Id: I165c0021fb195b399790b9cf14a7416ae75ec84f Signed-off-by: Amar Tumballi <amarts@redhat.com>
-rw-r--r--rpc/xdr/src/glusterfs3.h2
-rw-r--r--rpc/xdr/src/glusterfs4-xdr.x1
2 files changed, 3 insertions, 0 deletions
diff --git a/rpc/xdr/src/glusterfs3.h b/rpc/xdr/src/glusterfs3.h
index 6ab80a82922..abc6bf6d5da 100644
--- a/rpc/xdr/src/glusterfs3.h
+++ b/rpc/xdr/src/glusterfs3.h
@@ -728,6 +728,7 @@ dict_to_xdr(dict_t *this, gfx_dict *dict)
break;
case GF_DATA_TYPE_PTR:
+ case GF_DATA_TYPE_STR_OLD:
index++;
/* Ideally, each type of data stored in dictionary
should have type. A pointer type shouldn't be
@@ -854,6 +855,7 @@ xdr_to_dict(gfx_dict *dict, dict_t **to)
ret = dict_set_iatt(this, key, iatt, false);
break;
case GF_DATA_TYPE_PTR:
+ case GF_DATA_TYPE_STR_OLD:
value = GF_MALLOC(xpair->value.gfx_value_u.other.other_len + 1,
gf_common_mt_char);
if (!value) {
diff --git a/rpc/xdr/src/glusterfs4-xdr.x b/rpc/xdr/src/glusterfs4-xdr.x
index 5ee86c24a0b..5929e887db1 100644
--- a/rpc/xdr/src/glusterfs4-xdr.x
+++ b/rpc/xdr/src/glusterfs4-xdr.x
@@ -60,6 +60,7 @@ union gfx_value switch (gf_dict_data_type_t type) {
case GF_DATA_TYPE_GFUUID:
opaque uuid[16];
case GF_DATA_TYPE_PTR:
+ case GF_DATA_TYPE_STR_OLD:
opaque other<>;
};