smb3: check for and properly advertise directory lease support
authorSteve French <stfrench@microsoft.com>
Fri, 31 Aug 2018 20:12:10 +0000 (15:12 -0500)
committerSteve French <stfrench@microsoft.com>
Mon, 3 Sep 2018 04:21:42 +0000 (23:21 -0500)
commitf801568332321e2b1e7a8bd26c3e4913a312a2ec
treecc9936a0b914ed0dd70fd4c7d8f0224091b9bbe6
parent25f2573512d7b38bca4c0878109db9600b8b711f
smb3: check for and properly advertise directory lease support

Although servers will typically ignore unsupported features,
we should advertise the support for directory leases (as
Windows e.g. does) in the negotiate protocol capabilities we
pass to the server, and should check for the server capability
(CAP_DIRECTORY_LEASING) before sending a lease request for an
open of a directory.  This will prevent us from accidentally
sending directory leases to SMB2.1 or SMB2 server for example.

Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
fs/cifs/smb2ops.c
fs/cifs/smb2pdu.c