page_cache_read has to be able to read past the end of a file, in order to
create empty file pages in some cases. your check really belongs in
generic_file_readahead. here's the patch again, against 2.3.18ac10, i
think.
--- filemap.c.orig Fri Oct 1 14:33:06 1999
+++ filemap.c Fri Oct 1 14:41:20 1999
@@ -923,8 +923,10 @@
ahead = 0;
while (ahead < max_ahead) {
ahead += PAGE_CACHE_SIZE;
- if (page_cache_read(filp, raend + ahead) < 0)
- break;
+ if ((raend + ahead) < inode->i_size)
+ if (page_cache_read(filp, raend + ahead) >= 0)
+ continue;
+ break;
}
/*
* If we tried to read ahead some pages,
- Chuck Lever
-- corporate: <chuckl@netscape.com> personal: <chucklever@netscape.net> or <cel@monkey.org>The Linux Scalability project: http://www.citi.umich.edu/projects/linux-scalability/
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/