linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-fsdevel@vger.kernel.org, Jan Kara <jack@suse.cz>
Subject: [PATCH] mm: Add wait for page writeback in filemap_page_mkwrite()
Date: Wed, 31 Oct 2012 11:38:29 +0100	[thread overview]
Message-ID: <1351679910-18264-1-git-send-email-jack@suse.cz> (raw)

filemap_page_mkwrite() is the default function to handle writeable fault
of a page. So make it wait for page writeback when stable pages during
write are required by the underlying bdi.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 mm/filemap.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

  Darrick, can you add something like this patch to your series? After it
the only filesystems that don't get stable pages right are ncpfs, ceph,
cifs, ubifs, and ocfs2. There are also other filesystems which will end up
calling wait_on_page_writeback() unconditionally. I can fix these once the
generic patches are stabilized.

diff --git a/mm/filemap.c b/mm/filemap.c
index 83efee7..d4ed2c3 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1728,6 +1728,8 @@ int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
 	 * see the dirty page and writeprotect it again.
 	 */
 	set_page_dirty(page);
+	if (mapping_cap_stable_write(page->mapping))
+		wait_on_page_writeback(page);
 out:
 	sb_end_pagefault(inode->i_sb);
 	return ret;
-- 
1.7.1


                 reply	other threads:[~2012-10-31 10:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1351679910-18264-1-git-send-email-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=darrick.wong@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /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).