summaryrefslogtreecommitdiffstats
path: root/xlators/lib
diff options
context:
space:
mode:
authorKaushik BV <kaushikbv@gluster.com>2011-02-03 23:15:17 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-02-04 00:39:10 -0800
commit7f59d855bb160a14a517e82b71e4f387b50cbf63 (patch)
tree61b5b3a3d11f396ea10557d17052b358c1a96a03 /xlators/lib
parentdf9122f70deb6dbd0d950219ad1876e0a1ccd940 (diff)
libxlator: memdup the data that is required for aggregation of attributes
Signed-off-by: Kaushik BV <kaushikbv@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2339 ([glusterfs-3.1.2geosyncqa4]: crash in gsyncd script) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2339
Diffstat (limited to 'xlators/lib')
-rw-r--r--xlators/lib/src/libxlator.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/xlators/lib/src/libxlator.c b/xlators/lib/src/libxlator.c
index 7708f86e619..f43fd381b85 100644
--- a/xlators/lib/src/libxlator.c
+++ b/xlators/lib/src/libxlator.c
@@ -252,11 +252,15 @@ cluster_markeruuid_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
((volmark->sec == marker->volmark->sec)
&& (volmark->usec >= marker->volmark->usec))) {
- marker->volmark = volmark;
+ GF_FREE (marker->volmark);
+ marker->volmark = memdup (volmark, sizeof (struct volume_mark));
+ VALIDATE_OR_GOTO (marker->volmark, done);
}
} else {
- marker->volmark = volmark;
+ marker->volmark = memdup (volmark, sizeof (struct volume_mark));
+ VALIDATE_OR_GOTO (marker->volmark, done);
+
uuid_unparse (volmark->uuid, vol_uuid);
if (volmark->retval)
callcnt = 0;
@@ -277,7 +281,7 @@ done:
goto out;
}
}
- if (dict_set_static_bin (dict, GF_XATTR_MARKER_KEY,
+ if (dict_set_bin (dict, GF_XATTR_MARKER_KEY,
marker->volmark,
sizeof (struct volume_mark))) {
op_ret = -1;