

The filempa_nopage() logic will go into a tight loop if
do_page_cache_readahead() doesn't actually start I/O against the target page.
This can happen if the disk is read-congested, or if the filesystem doesn't
want to read that part of the file for some reason.

We will accidentally break out of the loop because

	 (ra->mmap_miss > ra->mmap_hit + MMAP_LOTSAMISS)

will eventually become true.

Fix that up.


---

 25-akpm/mm/filemap.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -puN mm/filemap.c~filemap_nopage-busywait-fix mm/filemap.c
--- 25/mm/filemap.c~filemap_nopage-busywait-fix	2004-04-03 03:04:14.047610448 -0800
+++ 25-akpm/mm/filemap.c	2004-04-03 03:04:14.052609688 -0800
@@ -1094,7 +1094,9 @@ retry_find:
 				pgoff = 0;
 			do_page_cache_readahead(mapping, file, pgoff, ra_pages);
 		}
-		goto retry_find;
+		page = find_get_page(mapping, pgoff);
+		if (!page)
+			goto no_cached_page;
 	}
 
 	if (!did_readaround)

_
