summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-01-18 07:04:26 +0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-02-01 04:28:08 +0400
commit2aeb98f498ce37742b743080fdc6c8cf64053599 (patch)
tree7ee6fddcb6006adfb40c90d5be00f5029ee0c1eb
parent536e43d12b9517bbbf6114cd1a12be27857a4d7a (diff)
downloadlinux-2aeb98f498ce37742b743080fdc6c8cf64053599.tar.xz
NFS: Ensure that mmapped pages remain stable during writeback
Ensure that nfs_vm_page_mkwrite() waits for the page writeback to complete before the application is allowed to modify page contents. The main reason for wanting to do this in NFS is to ensure that the server doesn't get confused if we have to resend the RPC request due to a dropped/missed reply. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/file.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index c43a452f7da2..4fdaaa63cf1c 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -530,6 +530,8 @@ static int nfs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
if (mapping != dentry->d_inode->i_mapping)
goto out_unlock;
+ wait_on_page_writeback(page);
+
pagelen = nfs_page_length(page);
if (pagelen == 0)
goto out_unlock;