]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
CIFS: Do not reset lease state to NONE on lease break
authorPavel Shilovsky <piastryyy@gmail.com>
Wed, 13 Feb 2019 23:43:08 +0000 (15:43 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 9 Jul 2019 21:04:11 +0000 (22:04 +0100)
commit588fe29cf5c3c6d6c098ffd6b6afeda91e49d71f
tree58a3f84840c2e2f8731065126415fc56c2fa1671
parent98afbb3781467280e5dd99b4484a0efd87291c4b
CIFS: Do not reset lease state to NONE on lease break

commit 7b9b9edb49ad377b1e06abf14354c227e9ac4b06 upstream.

Currently on lease break the client sets a caching level twice:
when oplock is detected and when oplock is processed. While the
1st attempt sets the level to the value provided by the server,
the 2nd one resets the level to None unconditionally.
This happens because the oplock/lease processing code was changed
to avoid races between page cache flushes and oplock breaks.
The commit c11f1df5003d534 ("cifs: Wait for writebacks to complete
before attempting write.") fixed the races for oplocks but didn't
apply the same changes for leases resulting in overwriting the
server granted value to None. Fix this by properly processing
lease breaks.

Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
[bwh: Backported to 3.16: drop change in smb311_operations]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/cifs/smb2misc.c
fs/cifs/smb2ops.c