diff options
author | Rohith Surabattula <rohiths@microsoft.com> | 2021-05-17 13:28:34 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2021-05-20 04:11:28 +0200 |
commit | 0ab95c2510b641fb860a773b3d242ef9768a8f66 (patch) | |
tree | b55de54e7a8ecfc56f8e01bc4e922b38d427c5ea /fs/cifs/smb2ops.c | |
parent | Fix kernel oops when CONFIG_DEBUG_ATOMIC_SLEEP is enabled. (diff) | |
download | linux-0ab95c2510b641fb860a773b3d242ef9768a8f66.tar.xz linux-0ab95c2510b641fb860a773b3d242ef9768a8f66.zip |
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 '')
-rw-r--r-- | fs/cifs/smb2ops.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index c693624a7267..21ef51d338e0 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -3983,6 +3983,7 @@ smb2_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock, unsigned int epoch, bool *purge_cache) { oplock &= 0xFF; + cinode->lease_granted = false; if (oplock == SMB2_OPLOCK_LEVEL_NOCHANGE) return; if (oplock == SMB2_OPLOCK_LEVEL_BATCH) { @@ -4009,6 +4010,7 @@ smb21_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock, unsigned int new_oplock = 0; oplock &= 0xFF; + cinode->lease_granted = true; if (oplock == SMB2_OPLOCK_LEVEL_NOCHANGE) return; |