cifs: Check the lease context if we actually got a lease
authorRonnie Sahlberg <lsahlber@redhat.com>
Fri, 17 Feb 2023 03:35:00 +0000 (13:35 +1000)
committerSteve French <stfrench@microsoft.com>
Thu, 1 Jun 2023 04:02:17 +0000 (23:02 -0500)
commit70dc44b107c26e1637458281e5556672e5499461
tree64630695ac4c3725df9bc5e923616451da14daa6
parent57058257ea5c99c77c015cb17a3f97d8f6a4cf9f
cifs: Check the lease context if we actually got a lease

Some servers may return that we got a lease in rsp->OplockLevel
but then in the lease context contradict this and say we got no lease
at all.  Thus we need to check the context if we have a lease.
Additionally, If we do not get a lease we need to make sure we close
the handle before we return an error to the caller.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Cc: stable@vger.kernel.org
Reviewed-by: Bharath SM <bharathsm@microsoft.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cached_dir.c