Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932461Ab1EIXDs (ORCPT ); Mon, 9 May 2011 19:03:48 -0400 Received: from e33.co.us.ibm.com ([32.97.110.151]:40881 "EHLO e33.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752871Ab1EIXDo (ORCPT ); Mon, 9 May 2011 19:03:44 -0400 Subject: [PATCH 2/7] fs: block_page_mkwrite should wait for writeback to finish To: Theodore Tso , Jan Kara , Alexander Viro , OGAWA Hirofumi , "Darrick J. Wong" From: "Darrick J. Wong" Cc: Jens Axboe , "Martin K. Petersen" , Jeff Layton , Dave Chinner , linux-kernel , Dave Hansen , Christoph Hellwig , linux-mm@kvack.org, Chris Mason , Joel Becker , linux-scsi , linux-fsdevel , linux-ext4@vger.kernel.org, Mingming Cao Date: Mon, 09 May 2011 16:03:34 -0700 Message-ID: <20110509230334.19566.17603.stgit@elm3c44.beaverton.ibm.com> In-Reply-To: <20110509230318.19566.66202.stgit@elm3c44.beaverton.ibm.com> References: <20110509230318.19566.66202.stgit@elm3c44.beaverton.ibm.com> User-Agent: StGit/0.15 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 972 Lines: 29 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 filesystems. Signed-off-by: Darrick J. Wong --- fs/buffer.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index a08bb8e..cf9a795 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2361,6 +2361,7 @@ block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, if (!ret) ret = block_commit_write(page, 0, end); + wait_on_page_writeback(page); if (unlikely(ret)) { unlock_page(page); if (ret == -ENOMEM) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/