diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2019-08-07 12:12:43 +0530 |
---|---|---|
committer | Krutika Dhananjay <kdhananj@redhat.com> | 2019-08-12 13:30:20 +0000 |
commit | 51237eda7c4b3846d08c5d24d1e3fe9b7ffba1d4 (patch) | |
tree | 271be723ada2ba337de4b4130a3df40631782abf /xlators/features | |
parent | 3cc0113ee436b63f69e16e4e0cd9443f1b3188ec (diff) |
features/shard: Send correct size when reads are sent beyond file size
Change-Id: I0cebaaf55c09eb1fb77a274268ff564e871b743b
fixes bz#1738419
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Diffstat (limited to 'xlators/features')
-rw-r--r-- | xlators/features/shard/src/shard.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c index 2b6b2513019..90f4998f3d9 100644 --- a/xlators/features/shard/src/shard.c +++ b/xlators/features/shard/src/shard.c @@ -4758,6 +4758,8 @@ out: if (xdata) local->xattr_rsp = dict_ref(xdata); vec.iov_base = local->iobuf->ptr; + if (local->offset + local->req_size > local->prebuf.ia_size) + local->total_size = local->prebuf.ia_size - local->offset; vec.iov_len = local->total_size; local->op_ret = local->total_size; SHARD_STACK_UNWIND(readv, frame, local->op_ret, local->op_errno, |