CIFS: Properly process SMB3 lease breaks
authorPavel Shilovsky <pshilov@microsoft.com>
Tue, 29 Oct 2019 23:51:19 +0000 (16:51 -0700)
committerSteve French <stfrench@microsoft.com>
Mon, 25 Nov 2019 07:17:12 +0000 (01:17 -0600)
commit9bd4540836684013aaad6070a65d6fcdd9006625
tree93f7efa7ff635683f5120f961cde3b852fc27f42
parent32546a9586aa4565035bb557e191648e022b29e8
CIFS: Properly process SMB3 lease breaks

Currenly we doesn't assume that a server may break a lease
from RWH to RW which causes us setting a wrong lease state
on a file and thus mistakenly flushing data and byte-range
locks and purging cached data on the client. This leads to
performance degradation because subsequent IOs go directly
to the server.

Fix this by propagating new lease state and epoch values
to the oplock break handler through cifsFileInfo structure
and removing the use of cifsInodeInfo flags for that. It
allows to avoid some races of several lease/oplock breaks
using those flags in parallel.

Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifsglob.h
fs/cifs/file.c
fs/cifs/misc.c
fs/cifs/smb1ops.c
fs/cifs/smb2misc.c
fs/cifs/smb2ops.c
fs/cifs/smb2pdu.h