From: Jan Kara Subject: Re: [PATCH 2/7] fs: block_page_mkwrite should wait for writeback to finish Date: Tue, 10 May 2011 14:41:03 +0200 Message-ID: <20110510124103.GC4402@quack.suse.cz> References: <20110509230318.19566.66202.stgit@elm3c44.beaverton.ibm.com> <20110509230334.19566.17603.stgit@elm3c44.beaverton.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Theodore Tso , Jan Kara , Alexander Viro , OGAWA Hirofumi , 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 To: "Darrick J. Wong" Return-path: Content-Disposition: inline In-Reply-To: <20110509230334.19566.17603.stgit@elm3c44.beaverton.ibm.com> Sender: owner-linux-mm@kvack.org List-Id: linux-ext4.vger.kernel.org On Mon 09-05-11 16:03:34, Darrick J. Wong wrote: > 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); Not that it matters much but it would seem more logical to me if we waited only in not-error case (i.e. after the error handling below). Honza > if (unlikely(ret)) { > unlock_page(page); > if (ret == -ENOMEM) > -- Jan Kara SUSE Labs, CR -- 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