|
@@ -2511,21 +2511,17 @@ generic_file_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
|
|
}
|
|
}
|
|
|
|
|
|
retval = mapping->a_ops->direct_IO(rw, iocb, iov, offset, nr_segs);
|
|
retval = mapping->a_ops->direct_IO(rw, iocb, iov, offset, nr_segs);
|
|
- if (retval)
|
|
|
|
- goto out;
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
* Finally, try again to invalidate clean pages which might have been
|
|
* Finally, try again to invalidate clean pages which might have been
|
|
- * faulted in by get_user_pages() if the source of the write was an
|
|
|
|
- * mmap()ed region of the file we're writing. That's a pretty crazy
|
|
|
|
- * thing to do, so we don't support it 100%. If this invalidation
|
|
|
|
- * fails and we have -EIOCBQUEUED we ignore the failure.
|
|
|
|
|
|
+ * cached by non-direct readahead, or faulted in by get_user_pages()
|
|
|
|
+ * if the source of the write was an mmap'ed region of the file
|
|
|
|
+ * we're writing. Either one is a pretty crazy thing to do,
|
|
|
|
+ * so we don't support it 100%. If this invalidation
|
|
|
|
+ * fails, tough, the write still worked...
|
|
*/
|
|
*/
|
|
if (rw == WRITE && mapping->nrpages) {
|
|
if (rw == WRITE && mapping->nrpages) {
|
|
- int err = invalidate_inode_pages2_range(mapping,
|
|
|
|
- offset >> PAGE_CACHE_SHIFT, end);
|
|
|
|
- if (err && retval >= 0)
|
|
|
|
- retval = err;
|
|
|
|
|
|
+ invalidate_inode_pages2_range(mapping, offset >> PAGE_CACHE_SHIFT, end);
|
|
}
|
|
}
|
|
out:
|
|
out:
|
|
return retval;
|
|
return retval;
|