[2/2] fs: block_page_mkwrite should wait for writeback to finish

Message ID 20110527192341.32105.95751.stgit@elm3c44.beaverton.ibm.com
State Not Applicable, archived
Headers show

Commit Message

Darrick J. Wong May 27, 2011, 7:23 p.m.
For filesystems such as nilfs2 and xfs that use block_page_mkwrite, modify that
function to wait for pending writeback before allowing the page to become
writable.  This is needed to stabilize pages during writeback for those two

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
 fs/buffer.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


diff --git a/fs/buffer.c b/fs/buffer.c
index 698c6b2..49c9aad 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2382,6 +2382,7 @@  int __block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
 		ret = -EAGAIN;
 		goto out_unlock;
+	wait_on_page_writeback(page);
 	return 0;