@@ -2410,6 +2410,17 @@ ssize_t cifs_strict_writev(struct kiocb *iocb, const struct iovec *iov,
if (CIFS_I(inode)->clientCanCacheAll)
return generic_file_aio_write(iocb, iov, nr_segs, pos);
+#ifdef CONFIG_CIFS_SMB2
+ else if (CIFS_I(inode)->clientCanCacheRead) {
+ ssize_t written;
+ int rc;
+ written = generic_file_aio_write(iocb, iov, nr_segs, pos);
+ rc = filemap_fdatawrite(inode->i_mapping);
+ if (rc)
+ return (ssize_t)rc;
+ return written;
+ }
+#endif
/*
* In strict cache mode we need to write the data to the server exactly