Whamcloud - gitweb
Branch b1_8
authorfanyong <fanyong>
Tue, 12 May 2009 06:05:25 +0000 (06:05 +0000)
committerfanyong <fanyong>
Tue, 12 May 2009 06:05:25 +0000 (06:05 +0000)
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
lustre/llite/file.c

index 12e52e1..746af2b 100644 (file)
@@ -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) ||
index e4e366a..eca7f74 100644 (file)
@@ -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) ||