diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2015-09-03 15:47:01 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-09-03 23:14:18 -0700 |
commit | 5bb4143e0a59ad69ac6ef74c2957784cf660c1fd (patch) | |
tree | ff14a65f89d67c6fd1a479e4aa881fb9779e5cbf /xlators | |
parent | 3050e26c1b733f722dd8dc17718f0c075c079fcf (diff) |
features/shard: Fix incorrect op_ret in READV
Backport of: http://review.gluster.org/#/c/12099/
Change-Id: Ica5f951a3cb2243fe179fe84a27c369bd7de23cf
BUG: 1259726
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/12101
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/features/shard/src/shard.c | 10 |
1 files changed, 8 insertions, 2 deletions
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); |