cifs: return a single-use cfid if we did not get a lease
authorRonnie Sahlberg <lsahlber@redhat.com>
Fri, 17 Feb 2023 03:35:01 +0000 (13:35 +1000)
committerSteve French <stfrench@microsoft.com>
Thu, 1 Jun 2023 04:02:29 +0000 (23:02 -0500)
commite218a6060cfe287756795f95935943539c25d0ce
tree59e558e0069d43d5a353b387b047b5041da461c9
parent70dc44b107c26e1637458281e5556672e5499461
cifs: return a single-use cfid if we did not get a lease

If we did not get a lease we can still return a single use cfid to the caller.
The cfid will not have has_lease set and will thus not be shared with any
other concurrent users and will be freed immediately when the caller
drops the handle.

This avoids extra roundtrips for servers that do not support directory leases
where they would first fail to get a cfid with a lease and then fallback
to try a normal SMB2_open()

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