aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/file.c')
-rw-r--r--fs/nfs/file.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index cc93865cea93..d6ee60fc3ba6 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -307,11 +307,14 @@ static int nfs_commit_write(struct file *file, struct page *page, unsigned offse
307 307
308static void nfs_invalidate_page(struct page *page, unsigned long offset) 308static void nfs_invalidate_page(struct page *page, unsigned long offset)
309{ 309{
310 struct inode *inode = page->mapping->host; 310 loff_t range_start, range_end;
311 311
312 if (offset != 0)
313 return;
312 /* Cancel any unstarted writes on this page */ 314 /* Cancel any unstarted writes on this page */
313 if (offset == 0) 315 range_start = page_offset(page);
314 nfs_sync_inode_wait(inode, page->index, 1, FLUSH_INVALIDATE); 316 range_end = range_start + (loff_t)(PAGE_CACHE_SIZE - 1);
317 nfs_sync_mapping_range(page->mapping, range_start, range_end, FLUSH_INVALIDATE);
315} 318}
316 319
317static int nfs_release_page(struct page *page, gfp_t gfp) 320static int nfs_release_page(struct page *page, gfp_t gfp)