diff options
author | Amar Tumballi <amar@gluster.com> | 2009-11-13 14:00:40 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-11-16 00:41:24 -0800 |
commit | 91f8b2a1668a4c63e0c21df4f7ac6dfb506f79d7 (patch) | |
tree | 1db6fad1cbe30d4f4b1bfb456a0ef7c52aa1069a /xlators/cluster/stripe/src/stripe.c | |
parent | 3c6647577f81568b7ad5cbf7435ef98aaa79e00a (diff) |
fixes in stripe
* fix in stripe readv, so that a read request which falls in
two (or more) subvolumes, depending on stripe-size works fine.
* fix in stripe_setattr_cbk, where 'postop' stat structure was
returning wrong 'st_size'.
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 368 (setattr on a non-regular file makes glusterfs crash)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=368
Diffstat (limited to 'xlators/cluster/stripe/src/stripe.c')
-rw-r--r-- | xlators/cluster/stripe/src/stripe.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index 0b0206019..02e09efbc 100644 --- a/xlators/cluster/stripe/src/stripe.c +++ b/xlators/cluster/stripe/src/stripe.c @@ -981,8 +981,9 @@ stripe_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local->stbuf.st_blocks += postop->st_blocks; - if (local->stbuf.st_size < postop->st_size) + if (local->stbuf.st_size < preop->st_size) local->pre_buf.st_size = preop->st_size; + if (local->stbuf.st_size < postop->st_size) local->stbuf.st_size = postop->st_size; if (local->stbuf.st_blksize != postop->st_blksize) { @@ -3196,7 +3197,7 @@ stripe_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, */ rounded_start = floor (offset, stripe_size); rounded_end = roof (offset+size, stripe_size); - num_stripe = (rounded_end - rounded_start) / stripe_size; + num_stripe = rounded_end/stripe_size - rounded_start/stripe_size; local = CALLOC (1, sizeof (stripe_local_t)); if (!local) { |