diff options
Diffstat (limited to 'xlators/storage')
-rw-r--r-- | xlators/storage/posix/src/posix.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index dcff1dbe29e..f1541a2da36 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -2530,7 +2530,13 @@ posix_readv (call_frame_t *frame, xlator_t *this, goto out; } - op_ret = vec.iov_len; + /* Hack to notify higher layers of EOF. */ + if (stbuf.st_size == 0) + op_errno = ENOENT; + else if ((offset + vec.iov_len) == stbuf.st_size) + op_errno = ENOENT; + + op_ret = vec.iov_len; out: STACK_UNWIND_STRICT (readv, frame, op_ret, op_errno, |