---

 25-akpm/mm/vmscan.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff -puN mm/vmscan.c~vmscan-handle-synchronous-writepage-fix mm/vmscan.c
--- 25/mm/vmscan.c~vmscan-handle-synchronous-writepage-fix	2004-05-21 01:25:04.642626640 -0700
+++ 25-akpm/mm/vmscan.c	2004-05-21 01:27:51.896200232 -0700
@@ -381,8 +381,9 @@ shrink_list(struct list_head *page_list,
 				 */
 				if (TestSetPageLocked(page))
 					goto keep;
-				if (PageWriteback(page))
+				if (PageDirty(page) || PageWriteback(page))
 					goto keep_locked;
+				mapping = page_mapping(page);
 			}
 		}
 
@@ -404,7 +405,7 @@ shrink_list(struct list_head *page_list,
 		 * the pages which were not successfully invalidated in
 		 * truncate_complete_page().  We try to drop those buffers here
 		 * and if that worked, and the page is no longer mapped into
-		 * process address space (page_count == 0) it can be freed.
+		 * process address space (page_count == 1) it can be freed.
 		 * Otherwise, leave the page on the LRU so it is swappable.
 		 */
 		if (PagePrivate(page)) {

_