From 390221fcc4cc974074750be223e551bd9f4405d9 Mon Sep 17 00:00:00 2001 From: "M. Mohan Kumar" Date: Fri, 11 Oct 2013 17:29:10 +0530 Subject: posix: Fix readv FOP Suggested by Anand Avati in BD xlator code review. Change-Id: I31c353a26dfdeb3d0023c3f7e03ed25461d13c16 Signed-off-by: M. Mohan Kumar BUG: 837495 Reviewed-on: http://review.gluster.org/6077 Reviewed-by: Vijay Bellur Tested-by: Vijay Bellur --- xlators/storage/posix/src/posix.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'xlators/storage/posix/src/posix.c') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 163ec928e95..61018804c7f 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -2072,11 +2072,7 @@ posix_readv (call_frame_t *frame, xlator_t *this, } /* Hack to notify higher layers of EOF. */ - if (stbuf.ia_size == 0) - op_errno = ENOENT; - else if ((offset + vec.iov_len) == stbuf.ia_size) - op_errno = ENOENT; - else if (offset > stbuf.ia_size) + if (!stbuf.ia_size || (offset + vec.iov_len) >= stbuf.ia_size) op_errno = ENOENT; op_ret = vec.iov_len; -- cgit