patch-2.0.8 linux/mm/filemap.c

Next file: linux/mm/memory.c
Previous file: linux/kernel/sys.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.7/linux/mm/filemap.c linux/mm/filemap.c
@@ -782,7 +782,8 @@
 	 * Ok, found a page in the page cache, now we need to check
 	 * that it's up-to-date
 	 */
-	wait_on_page(page);
+	if (PageLocked(page))
+		goto page_locked_wait;
 	if (!PageUptodate(page))
 		goto page_read_error;
 
@@ -849,6 +850,11 @@
 		new_page = try_to_read_ahead(inode, offset + PAGE_SIZE, 0);
 	goto found_page;
 
+page_locked_wait:
+	__wait_on_page(page);
+	if (PageUptodate(page))
+		goto success;
+	
 page_read_error:
 	/*
 	 * Umm, take care of errors if the page isn't up-to-date.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov