From 91f8b2a1668a4c63e0c21df4f7ac6dfb506f79d7 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 13 Nov 2009 14:00:40 +0000 Subject: 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 Signed-off-by: Anand V. Avati BUG: 368 (setattr on a non-regular file makes glusterfs crash) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=368 --- xlators/cluster/stripe/src/stripe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xlators') diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index 0b02060195e..02e09efbcd1 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) { -- cgit