aboutsummaryrefslogtreecommitdiffstats
path: root/mm/filemap.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-09 03:02:35 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-09 03:02:35 -0400
commit1236d6bb6e19fc72ffc6bbcdeb1bfefe450e54ee (patch)
tree47da3feee8e263e8c9352c85cf518e624be3c211 /mm/filemap.c
parent750b1a6894ecc9b178c6e3d0a1170122971b2036 (diff)
parent8a5776a5f49812d29fe4b2d0a2d71675c3facf3f (diff)
Merge 4.14-rc4 into staging-next
We want the staging/iio fixes in here as well to handle merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 870971e20967..594d73fef8b4 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -620,6 +620,14 @@ int file_check_and_advance_wb_err(struct file *file)
620 trace_file_check_and_advance_wb_err(file, old); 620 trace_file_check_and_advance_wb_err(file, old);
621 spin_unlock(&file->f_lock); 621 spin_unlock(&file->f_lock);
622 } 622 }
623
624 /*
625 * We're mostly using this function as a drop in replacement for
626 * filemap_check_errors. Clear AS_EIO/AS_ENOSPC to emulate the effect
627 * that the legacy code would have had on these flags.
628 */
629 clear_bit(AS_EIO, &mapping->flags);
630 clear_bit(AS_ENOSPC, &mapping->flags);
623 return err; 631 return err;
624} 632}
625EXPORT_SYMBOL(file_check_and_advance_wb_err); 633EXPORT_SYMBOL(file_check_and_advance_wb_err);
@@ -2926,9 +2934,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, 2934 * we're writing. Either one is a pretty crazy thing to do,
2927 * so we don't support it 100%. If this invalidation 2935 * so we don't support it 100%. If this invalidation
2928 * fails, tough, the write still worked... 2936 * fails, tough, the write still worked...
2937 *
2938 * Most of the time we do not need this since dio_complete() will do
2939 * the invalidation for us. However there are some file systems that
2940 * do not end up with dio_complete() being called, so let's not break
2941 * them by removing it completely
2929 */ 2942 */
2930 invalidate_inode_pages2_range(mapping, 2943 if (mapping->nrpages)
2931 pos >> PAGE_SHIFT, end); 2944 invalidate_inode_pages2_range(mapping,
2945 pos >> PAGE_SHIFT, end);
2932 2946
2933 if (written > 0) { 2947 if (written > 0) {
2934 pos += written; 2948 pos += written;