aboutsummaryrefslogtreecommitdiff
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
authorLorDClockaN <davor@losinj.com>2019-03-27 18:32:24 +0100
committerLorDClockaN <davor@losinj.com>2019-03-27 18:32:24 +0100
commita8e12a51a8c22de9f1281b06f3cd85de5d0ab564 (patch)
tree45230cd53d8092c346bd00810e3046fcea43666a /fs/cifs/file.c
parent92857b007d911bfff7e65465694d28bf8fe96fc7 (diff)
parentb96e2451dc7dc8df5b5b330af0e96a8ae0e5a421 (diff)
Merge branch 'p9x' of https://github.com/DirtyUnicorns/android_kernel_google_bluecross.git into HEADHEADp9.0
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 8ec296308729..1c5099fffaec 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -2797,14 +2797,16 @@ cifs_strict_writev(struct kiocb *iocb, struct iov_iter *from)
* these pages but not on the region from pos to ppos+len-1.
*/
written = cifs_user_writev(iocb, from);
- if (written > 0 && CIFS_CACHE_READ(cinode)) {
+ if (CIFS_CACHE_READ(cinode)) {
/*
- * Windows 7 server can delay breaking level2 oplock if a write
- * request comes - break it on the client to prevent reading
- * an old data.
+ * We have read level caching and we have just sent a write
+ * request to the server thus making data in the cache stale.
+ * Zap the cache and set oplock/lease level to NONE to avoid
+ * reading stale data from the cache. All subsequent read
+ * operations will read new data from the server.
*/
cifs_zap_mapping(inode);
- cifs_dbg(FYI, "Set no oplock for inode=%p after a write operation\n",
+ cifs_dbg(FYI, "Set Oplock/Lease to NONE for inode=%p after write\n",
inode);
cinode->oplock = 0;
}