Skip to content

Commit

Permalink
NFS: Ensure that mmapped pages remain stable during writeback
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Feb 1, 2012
1 parent 536e43d commit 2aeb98f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/nfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2aeb98f

Please sign in to comment.