[PATCH] mm: Add wait for page writeback in filemap_page_mkwrite()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux