From dca4de364cd948ec7dade4416425ea1353911066 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Fri, 3 Jun 2016 04:22:27 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/14658 Tested-by: Krutika Dhananjay Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Krutika Dhananjay NetBSD-regression: NetBSD Build System --- xlators/features/shard/src/shard.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'xlators') diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c index df841243926..d3e8ba330f4 100644 --- a/xlators/features/shard/src/shard.c +++ b/xlators/features/shard/src/shard.c @@ -3314,8 +3314,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; @@ -3350,21 +3348,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); -- cgit