summaryrefslogtreecommitdiff
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
authorRohith Surabattula <rohiths@microsoft.com>2021-05-17 11:28:34 +0000
committerSteve French <stfrench@microsoft.com>2021-05-19 21:11:28 -0500
commit0ab95c2510b641fb860a773b3d242ef9768a8f66 (patch)
treeb55de54e7a8ecfc56f8e01bc4e922b38d427c5ea /fs/cifs/file.c
parent860b69a9d77160d21ca00357fd6c5217f9d41fb1 (diff)
Defer close only when lease is enabled.
When smb2 lease parameter is disabled on server. Server grants batch oplock instead of RHW lease by default on open, inode page cache needs to be zapped immediatley upon close as cache is not valid. Signed-off-by: Rohith Surabattula <rohiths@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 304d9d3783c6..a1abd3da1d44 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -896,6 +896,7 @@ int cifs_close(struct inode *inode, struct file *file)
file->private_data = NULL;
dclose = kmalloc(sizeof(struct cifs_deferred_close), GFP_KERNEL);
if ((cinode->oplock == CIFS_CACHE_RHW_FLG) &&
+ cinode->lease_granted &&
dclose) {
if (test_bit(CIFS_INO_MODIFIED_ATTR, &cinode->flags))
inode->i_ctime = inode->i_mtime = current_time(inode);