diff options
Diffstat (limited to 'mm/filemap.c')
-rw-r--r-- | mm/filemap.c | 18 |
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 | } |
625 | EXPORT_SYMBOL(file_check_and_advance_wb_err); | 633 | EXPORT_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; |