From: Ram Pai do_generic_mapping_read() currently tries to read an extra page outside i_size when the file size is a multiple of 4k. Fix. Signed-off-by: Andrew Morton --- 25-akpm/mm/filemap.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff -puN mm/filemap.c~filemap_index_overflow mm/filemap.c --- 25/mm/filemap.c~filemap_index_overflow 2004-08-16 11:38:44.869435640 -0700 +++ 25-akpm/mm/filemap.c 2004-08-16 11:38:44.874434880 -0700 @@ -719,14 +719,18 @@ void do_generic_mapping_read(struct addr offset = *ppos & ~PAGE_CACHE_MASK; isize = i_size_read(inode); - end_index = isize >> PAGE_CACHE_SHIFT; - if (index > end_index) + if (!isize) goto out; + end_index = isize >> PAGE_CACHE_SHIFT; + for (;;) { struct page *page; unsigned long nr, ret; + if (index > end_index) + goto out; + cond_resched(); page_cache_readahead(mapping, &ra, filp, index); _