When doing shared mmap writes, the resulting dirty NFS pages may
find themselves incapable of being flushed out if I/O is started
after the file was released.
Make sure we start I/O on all existing dirty pages in nfs_file_release().
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
static int
nfs_file_release(struct inode *inode, struct file *filp)
{
+ /* Ensure that dirty pages are flushed out with the right creds */
+ if (filp->f_mode & FMODE_WRITE)
+ filemap_fdatawrite(filp->f_mapping);
return NFS_PROTO(inode)->file_release(inode, filp);
}