Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933256Ab1ESWtI (ORCPT ); Thu, 19 May 2011 18:49:08 -0400 Received: from e37.co.us.ibm.com ([32.97.110.158]:50139 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932822Ab1ESWtE (ORCPT ); Thu, 19 May 2011 18:49:04 -0400 Subject: [PATCH 2/3] fs: block_page_mkwrite should wait for writeback to finish To: Alexander Viro , "Darrick J. Wong" From: "Darrick J. Wong" Cc: Jens Axboe , Theodore Tso , "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 , Jan Kara , linux-ext4@vger.kernel.org, Mingming Cao Date: Thu, 19 May 2011 15:48:55 -0700 Message-ID: <20110519224855.28755.2720.stgit@elm3c44.beaverton.ibm.com> In-Reply-To: <20110519224841.28755.80650.stgit@elm3c44.beaverton.ibm.com> References: <20110519224841.28755.80650.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: 1008 Lines: 33 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 | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index a08bb8e..0e7fa16 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2367,8 +2367,10 @@ block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, ret = VM_FAULT_OOM; else /* -ENOSPC, -EIO, etc */ ret = VM_FAULT_SIGBUS; - } else + } else { + wait_on_page_writeback(page); ret = VM_FAULT_LOCKED; + } out: return ret; -- 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/