From: "Darrick J. Wong" Subject: [PATCH 2/3] fs: block_page_mkwrite should wait for writeback to finish Date: Thu, 19 May 2011 15:48:55 -0700 Message-ID: <20110519224855.28755.2720.stgit@elm3c44.beaverton.ibm.com> References: <20110519224841.28755.80650.stgit@elm3c44.beaverton.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 To: Alexander Viro , "Darrick J. Wong" Return-path: In-Reply-To: <20110519224841.28755.80650.stgit@elm3c44.beaverton.ibm.com> Sender: owner-linux-mm@kvack.org List-Id: linux-ext4.vger.kernel.org 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, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org