diff options
author | Krishnan P <kp@gluster.com> | 2011-06-16 01:26:55 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-06-16 09:15:06 -0700 |
commit | 87508c1edc7b8f4a88b2506ac642e878b1f2ac16 (patch) | |
tree | af7aed29b3b789cc1eadf431d3f766ba6db9ace0 /xlators | |
parent | 84fe7114833aed4efc31a1beaf7fcff0124c0ab4 (diff) |
afr: holding stack var via dict_set_static_bin corrupts.
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 3033 (Changes to replace-brick and syntask interface.)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3033
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 2b073eb9c72..a08f34b8757 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -63,14 +63,27 @@ int32_t afr_set_dict_gfid (dict_t *dict, uuid_t gfid) { - int ret = 0; + int ret = 0; + uuid_t *pgfid = NULL; GF_ASSERT (gfid); - ret = dict_set_static_bin (dict, "gfid-req", gfid, 16); + pgfid = GF_CALLOC (1, sizeof (uuid_t), gf_common_mt_char); + if (!pgfid) { + ret = -1; + goto out; + } + + uuid_copy (*pgfid, gfid); + + ret = dict_set_dynptr (dict, "gfid-req", pgfid, sizeof (uuid_t)); if (ret) gf_log (THIS->name, GF_LOG_DEBUG, "gfid set failed"); +out: + if (ret && pgfid) + GF_FREE (pgfid); + return ret; } |