Re: [PATCH] _isofs_bmap warning and readahead cache in 2.3

Chuck Lever (cel@monkey.org)
Mon, 11 Oct 1999 10:40:19 -0400 (EDT)


On Mon, 11 Oct 1999, Vladimir Chernyshov wrote:
> The readahead cache in development kernels often tries to get
> additional blocks from block device without checking for the next block
> to be inside file boundary. This cause annoying messages when reading
> file from filesystem, that make additional checking itself.
> Like this:
>
> Oct 7 17:04:05 greengrass kernel: _isofs_bmap: block >= EOF (4, 5542)
> Oct 7 17:04:05 greengrass kernel: _isofs_bmap: block >= EOF (5, 5542)
> Oct 7 17:04:05 greengrass kernel: _isofs_bmap: block >= EOF (6, 5542)
> Oct 7 17:04:05 greengrass kernel: _isofs_bmap: block >= EOF (7, 5542)
>
> Seems, the check has been removed from mm/filemap.c some time ago.
> Is it a bug or a feature?
> If it's a bug, here's a patch...

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/