diff options
author | Amar Tumballi <amar@gluster.com> | 2010-03-29 02:06:46 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-03-31 00:08:26 -0700 |
commit | 5ef3101321952bb1c01282f419fd25442a920f41 (patch) | |
tree | c8ddac60ec5b21e5ec6987c2087710b77c0d4f2e | |
parent | a0dfbcdad536e42ae08a59b59de3aca3d11d95e8 (diff) |
stripe readv: proper 'op_ret' validation
Thanks to Raghavendra Bhat <raghavendrabhat@gluster.com> for reporting
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
-rw-r--r-- | xlators/cluster/stripe/src/stripe.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index 009b279b154..cbfbf288466 100644 --- a/xlators/cluster/stripe/src/stripe.c +++ b/xlators/cluster/stripe/src/stripe.c @@ -2793,11 +2793,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))) { |