diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2016-06-03 04:22:27 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-06-27 08:18:40 -0700 |
commit | cac16a0e5713f85a65f03b3eb5b62abfa894ac94 (patch) | |
tree | de2610176bb8a3ffa914aa95c31c9f16285552c0 /xlators/features/shard | |
parent | 42d6a493570599277ed88b51ab0fb9760840ed1b (diff) |
features/shard: Don't modify readv size
Backport of: http://review.gluster.org/14623
For o-direct reads application sends aligned size which needs to be
sent as is, otherwise o-direct writes where the file-size is not
aligned fails.
>Change-Id: I66afcba41f3484da11e9a12fe2671d2051fafc8a
>BUG: 1342903
>Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
>Reviewed-on: http://review.gluster.org/14658
>Tested-by: Krutika Dhananjay <kdhananj@redhat.com>
>Smoke: Gluster Build System <jenkins@build.gluster.org>
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
>Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
BUG: 1347553
Change-Id: I1adcdaccbd5686986a057314efab9a646afa3d47
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/14752
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Tested-by: Krutika Dhananjay <kdhananj@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/features/shard')
-rw-r--r-- | xlators/features/shard/src/shard.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c index 754987c229d..28f1a51d330 100644 --- a/xlators/features/shard/src/shard.c +++ b/xlators/features/shard/src/shard.c @@ -3317,8 +3317,6 @@ int shard_post_lookup_readv_handler (call_frame_t *frame, xlator_t *this) { int ret = 0; - size_t read_size = 0; - size_t actual_size = 0; struct iobuf *iobuf = NULL; shard_local_t *local = NULL; shard_priv_t *priv = NULL; @@ -3353,21 +3351,10 @@ shard_post_lookup_readv_handler (call_frame_t *frame, xlator_t *this) return 0; } - read_size = (local->offset + local->req_size); - actual_size = local->prebuf.ia_size; - local->first_block = get_lowest_block (local->offset, local->block_size); - /* If the end of read surpasses the file size, only resolve and read - * till the end of the file size. If the read is confined within the - * size of the file, read only the requested size. - */ - - if (read_size >= actual_size) - local->total_size = actual_size - local->offset; - else - local->total_size = local->req_size; + local->total_size = local->req_size; local->last_block = get_highest_block (local->offset, local->total_size, local->block_size); |