summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2011-11-03 14:33:24 +0530
committerVijay Bellur <vijay@gluster.com>2011-11-03 06:16:37 -0700
commit208244f0126886a60ae7b2a2e8126a7bab6040cb (patch)
treebbbf2cee65596a0cacc88df12e865f10cdcb255b
parent126e4fa58119c76ff78a5af88237a61ab0662531 (diff)
stripe readv_cbk: Propogate the correct size and blk cnt in stbuf
We were passing the stbuf returned by the first child/index, which can be different to the size/blocks returned by stat. This led to applications viewing the file as being truncated. The stbuf size needs to be the largest of all results, and blocks the aggregation from all subvolumes. (similar to stat) Change-Id: I0782f2d0d48b53c5c507a2b1fc62a6132a31ce12 BUG: 3774 Reviewed-on: http://review.gluster.com/664 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
-rw-r--r--xlators/cluster/stripe/src/stripe.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index d47acd6b3..d42d88b12 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -3555,6 +3555,9 @@ stripe_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
mlocal->replies[index].stbuf = *stbuf;
mlocal->replies[index].count = count;
mlocal->replies[index].vector = iov_dup (vector, count);
+ if (local->stbuf_size < stbuf->ia_size)
+ local->stbuf_size = stbuf->ia_size;
+ local->stbuf_blocks += stbuf->ia_blocks;
if (!mlocal->iobref)
mlocal->iobref = iobref_new ();
@@ -3612,6 +3615,8 @@ stripe_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
* cause any bugs at higher levels */
memcpy (&tmp_stbuf, &mlocal->replies[0].stbuf,
sizeof (struct iatt));
+ tmp_stbuf.ia_size = local->stbuf_size;
+ tmp_stbuf.ia_blocks = local->stbuf_blocks;
done:
/* */