linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: "Darrick J. Wong" <djwong@us.ibm.com>
Cc: Jan Kara <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	Al Viro <viro@ZenIV.linux.org.uk>,
	tytso@mit.edu, Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH 0/3] Make block_page_mkwrite() handle frozen fs (V2)
Date: Thu, 19 May 2011 14:30:29 +0200	[thread overview]
Message-ID: <20110519123029.GI8417@quack.suse.cz> (raw)
In-Reply-To: <20110518180022.GM18929@tux1.beaverton.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 1128 bytes --]

On Wed 18-05-11 11:00:22, Darrick J. Wong wrote:
> On Wed, May 18, 2011 at 05:17:59PM +0200, Jan Kara wrote:
> > 
> >   Hi,
> > 
> >   this is a second version of my patches which rewrite ext4_page_mkwrite() to
> > use generic helper. When we are already changing this code, I also added proper
> > handling of frozen filesystem there in patch 2/3. I've incorporated suggestions
> > from Christoph in the patches which resulted in some patch reorg. I'd like to
> > get these patches reviewed and then get them merged possibly via ext4-tree
> > (although the first two patches might go via Al but that would complicate
> > merging of ext4 part where I expect more conflicts with ongoing work).
> 
> Do you want me to generate a patch to add wait_on_page_writeback to the
> appropriate place(s) in your new *_page_mkwrite functions, or do you plan to
> add them yourself?
> 
> (iow: is there an order for pushing these ext4_page_mkwrite changes?)
  Attached is a rebase of your block_page_mkwrite change on top of my
patches. I'm not sure what is the actual status your series - have you
pushed VFS changes to Al?

									Honza

[-- Attachment #2: 0001-vfs-Wait-in-__block_page_mkwrite-for-IO-to-finish.patch --]
[-- Type: text/x-patch, Size: 1124 bytes --]

>From 408d0a667ebdc7edd24d05c8de4b42cc1629e84f Mon Sep 17 00:00:00 2001
From: Darrick J. Wong <djwong@us.ibm.com>
Date: Thu, 19 May 2011 14:14:11 +0200
Subject: [PATCH] vfs: Wait in __block_page_mkwrite for IO to finish

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 <djwong@us.ibm.com>
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/buffer.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index b0675bf..161685d 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2365,6 +2365,8 @@ int __block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
 
 	if (unlikely(ret < 0))
 		goto out_unlock;
+	/* Wait so that we don't change page under IO */
+	wait_on_page_writeback(page);
 	/*
 	 * Freezing in progress? We check after the page is marked dirty and
 	 * with page lock held so if the test here fails, we are sure freezing
-- 
1.7.1


  parent reply	other threads:[~2011-05-19 12:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 15:17 [PATCH 0/3] Make block_page_mkwrite() handle frozen fs (V2) Jan Kara
2011-05-18 15:18 ` [PATCH 1/3] fs: Create __block_page_mkwrite() helper passing error values back Jan Kara
2011-05-18 18:07   ` Christoph Hellwig
2011-05-18 15:18 ` [PATCH 2/3] vfs: Block mmapped writes while the fs is frozen Jan Kara
2011-05-18 18:12   ` Christoph Hellwig
2011-05-19 12:08     ` Jan Kara
2011-05-18 15:18 ` [PATCH 3/3] ext4: Rewrite ext4_page_mkwrite() to return locked page Jan Kara
2011-05-18 18:00 ` [PATCH 0/3] Make block_page_mkwrite() handle frozen fs (V2) Darrick J. Wong
2011-05-19 10:57   ` Jan Kara
2011-05-20 17:59     ` Ted Ts'o
2011-05-23 13:21       ` Jan Kara
2011-05-23 14:47         ` Ted Ts'o
2011-05-19 12:30   ` Jan Kara [this message]
2011-05-19 16:34     ` Darrick J. Wong
2011-05-18 18:13 ` Christoph Hellwig
2011-05-19 12:24   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110519123029.GI8417@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=djwong@us.ibm.com \
    --cc=hch@infradead.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).