NFS: Flesh out nfs_invalidate_page()
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / nfs / file.c
index 63154070145af23d61414ade14f4964c4b37a676..106ef0dec04dd0ed0f26b059c203fd84c2cfa853 100644 (file)
@@ -303,7 +303,11 @@ static int nfs_commit_write(struct file *file, struct page *page, unsigned offse
 
 static void nfs_invalidate_page(struct page *page, unsigned long offset)
 {
-       /* FIXME: we really should cancel any unstarted writes on this page */
+       struct inode *inode = page->mapping->host;
+
+       /* Cancel any unstarted writes on this page */
+       if (offset == 0)
+               nfs_sync_inode_wait(inode, page->index, 1, FLUSH_INVALIDATE);
 }
 
 static int nfs_release_page(struct page *page, gfp_t gfp)