]> www.infradead.org Git - users/jedix/linux-maple.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:34:06 +0000 (09:34 +0100)
commitf5a6d69857ebf3dde71c2efaab2f67a97549ddab
treee2b3094a090286312fbe35864d0a9d6db37bcec3
parentc992b699b9cb9551d2202fff2b932e526b28b714
cifs: return a single-use cfid if we did not get a lease

commit 8e843bf38f7be0766642a91523cfa65f2b021a8a upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/cached_dir.c