]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] NFS: Ensure that dirty pages are written with the right creds.
authorTrond Myklebust <trond.myklebust@fys.uio.no>
Tue, 15 Mar 2005 11:44:28 +0000 (03:44 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 15 Mar 2005 11:44:28 +0000 (03:44 -0800)
 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>
fs/nfs/file.c

index bae0528bad8a86366ff692c2e959a1d66ea2d070..f06eee6dcff57e3d4d4d7f88fe71545fd5b2c6e6 100644 (file)
@@ -108,6 +108,9 @@ nfs_file_open(struct inode *inode, struct file *filp)
 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);
 }