From 18e6e3990e16148dad002833f09b080f3131b439 Mon Sep 17 00:00:00 2001 From: fanyong Date: Tue, 12 May 2009 06:05:25 +0000 Subject: [PATCH] Branch b1_8 b=17336 i=robert.read i=jinshan.xiong Do not trigger readpage when objective page index exceeds the end-of-file page index. --- lustre/liblustre/rw.c | 2 +- lustre/llite/file.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/liblustre/rw.c b/lustre/liblustre/rw.c index 12e52e1..746af2b 100644 --- a/lustre/liblustre/rw.c +++ b/lustre/liblustre/rw.c @@ -707,7 +707,7 @@ ssize_t llu_file_prwv(const struct iovec *iovec, int iovlen, } else { /* If objective page index exceed end-of-file * page index, return directly. --bug 17336 */ - size_t size = st->st_size; + loff_t size = st->st_size; unsigned long cur_index = pos >> CFS_PAGE_SHIFT; if ((size == 0 && cur_index != 0) || diff --git a/lustre/llite/file.c b/lustre/llite/file.c index e4e366a..eca7f74 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -1556,7 +1556,7 @@ repeat: * index, return directly. Do not expect kernel will * check such case correctly. linux-2.6.18-128.1.1 miss * to do that. --bug 17336 */ - size_t size = i_size_read(inode); + loff_t size = i_size_read(inode); unsigned long cur_index = *ppos >> CFS_PAGE_SHIFT; if ((size == 0 && cur_index != 0) || -- 1.8.3.1