From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

When cont_prepare_write() is padding out the "hole" with zeroed pages it
doesn't increase i_size at the same time.  If writeback comes in during the
execution of cont_prepare_write(), block_write_full_page() will think that
these pages are outside i_size and will just clean the page without writing
it.

Fix that up by using generic_commit_write(), which will advance i_size for
each page as it is dirtied.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/buffer.c |    3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)

diff -puN fs/buffer.c~cont_prepare_write-fix fs/buffer.c
--- 25/fs/buffer.c~cont_prepare_write-fix	Tue Nov 23 16:07:15 2004
+++ 25-akpm/fs/buffer.c	Tue Nov 23 16:07:15 2004
@@ -2224,8 +2224,7 @@ int cont_prepare_write(struct page *page
 		memset(kaddr+zerofrom, 0, PAGE_CACHE_SIZE-zerofrom);
 		flush_dcache_page(new_page);
 		kunmap_atomic(kaddr, KM_USER0);
-		__block_commit_write(inode, new_page,
-				zerofrom, PAGE_CACHE_SIZE);
+		generic_commit_write(NULL, new_page, zerofrom, PAGE_CACHE_SIZE);
 		unlock_page(new_page);
 		page_cache_release(new_page);
 	}
_