summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-03-29 02:08:54 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-03-31 00:08:22 -0700
commitd99804c05fe6302f638c6d748c1613a595390cd5 (patch)
tree5c2d0115f25f18151e93789ecc1518c2013e3271 /xlators
parentcf99ded428cfdf562d5cd220c77dfc8b4617d9d8 (diff)
stripe readv: proper validation of 'op_ret'.
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 536 (fsx tool fails over stripe) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=536
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/stripe/src/stripe.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index 0a47af124a8..a7fad23da81 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -2853,11 +2853,12 @@ stripe_readv_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
for (i = 0; i < local->wind_count; i++) {
- memcpy ((vec + count), local->replies[i].vector,
- (local->replies[i].count * sizeof (struct iovec)));
- count += local->replies[i].count;
- op_ret += local->replies[i].op_ret;
-
+ if (local->replies[i].op_ret) {
+ memcpy ((vec + count), local->replies[i].vector,
+ (local->replies[i].count * sizeof (struct iovec)));
+ count += local->replies[i].count;
+ op_ret += local->replies[i].op_ret;
+ }
if ((local->replies[i].op_ret <
local->replies[i].requested_size) &&
(local->stbuf_size > (local->offset + op_ret))) {