diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/filemap.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index 870971e20967..db250d0e0565 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -2926,9 +2926,15 @@ generic_file_direct_write(struct kiocb *iocb, struct iov_iter *from) | |||
2926 | * we're writing. Either one is a pretty crazy thing to do, | 2926 | * we're writing. Either one is a pretty crazy thing to do, |
2927 | * so we don't support it 100%. If this invalidation | 2927 | * so we don't support it 100%. If this invalidation |
2928 | * fails, tough, the write still worked... | 2928 | * fails, tough, the write still worked... |
2929 | * | ||
2930 | * Most of the time we do not need this since dio_complete() will do | ||
2931 | * the invalidation for us. However there are some file systems that | ||
2932 | * do not end up with dio_complete() being called, so let's not break | ||
2933 | * them by removing it completely | ||
2929 | */ | 2934 | */ |
2930 | invalidate_inode_pages2_range(mapping, | 2935 | if (mapping->nrpages) |
2931 | pos >> PAGE_SHIFT, end); | 2936 | invalidate_inode_pages2_range(mapping, |
2937 | pos >> PAGE_SHIFT, end); | ||
2932 | 2938 | ||
2933 | if (written > 0) { | 2939 | if (written > 0) { |
2934 | pos += written; | 2940 | pos += written; |