summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix-aio.c
diff options
context:
space:
mode:
authorM. Mohan Kumar <mohan@in.ibm.com>2013-10-11 17:29:10 +0530
committerVijay Bellur <vbellur@redhat.com>2013-10-17 04:15:24 -0700
commit390221fcc4cc974074750be223e551bd9f4405d9 (patch)
treefdb3dc25a9dec3dbe567d5e88116b7dd2e5d987d /xlators/storage/posix/src/posix-aio.c
parent5033d450ca039b77b9245006e1de7c950754dbb1 (diff)
posix: Fix readv FOP
Suggested by Anand Avati in BD xlator code review. Change-Id: I31c353a26dfdeb3d0023c3f7e03ed25461d13c16 Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> BUG: 837495 Reviewed-on: http://review.gluster.org/6077 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix-aio.c')
-rw-r--r--xlators/storage/posix/src/posix-aio.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/xlators/storage/posix/src/posix-aio.c b/xlators/storage/posix/src/posix-aio.c
index 5eed7f1..c3bbddd 100644
--- a/xlators/storage/posix/src/posix-aio.c
+++ b/xlators/storage/posix/src/posix-aio.c
@@ -136,11 +136,7 @@ posix_aio_readv_complete (struct posix_aio_cb *paiocb, int res, int res2)
/* Hack to notify higher layers of EOF. */
- if (postbuf.ia_size == 0)
- op_errno = ENOENT;
- else if ((offset + iov.iov_len) == postbuf.ia_size)
- op_errno = ENOENT;
- else if (offset > postbuf.ia_size)
+ if (!postbuf.ia_size || (offset + iov.iov_len) >= postbuf.ia_size)
op_errno = ENOENT;
LOCK (&priv->lock);