From fe7b37960bbef791d9bed79760b61b1d40ca81cd Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Thu, 3 Sep 2015 15:47:01 +0530 Subject: features/shard: Fix incorrect op_ret in READV Change-Id: I31ac99b290f82f4b74236c206193f7641c73d4dc BUG: 1259651 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/12099 Reviewed-by: Pranith Kumar Karampuri Tested-by: NetBSD Build System --- xlators/features/shard/src/shard.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'xlators/features/shard') diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c index 8b784eca1a8..74d75758f59 100644 --- a/xlators/features/shard/src/shard.c +++ b/xlators/features/shard/src/shard.c @@ -2362,6 +2362,12 @@ shard_readv_do_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; + /* If shard has already seen a failure here before, there is no point + * in aggregating subsequent reads, so just go to out. + */ + if (local->op_ret < 0) + goto out; + if (op_ret < 0) { local->op_ret = op_ret; local->op_errno = op_errno; @@ -2408,8 +2414,8 @@ out: if (xdata) local->xattr_rsp = dict_ref (xdata); vec.iov_base = local->iobuf->ptr; - vec.iov_len = local->op_ret; - SHARD_STACK_UNWIND (readv, frame, local->op_ret, + vec.iov_len = local->total_size; + SHARD_STACK_UNWIND (readv, frame, local->total_size, local->op_errno, &vec, 1, &local->prebuf, local->iobref, local->xattr_rsp); -- cgit