]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
smb3: request handle caching when caching directories
authorSteve French <stfrench@microsoft.com>
Mon, 18 Nov 2024 18:19:46 +0000 (12:19 -0600)
committerSteve French <stfrench@microsoft.com>
Thu, 21 Nov 2024 16:45:15 +0000 (10:45 -0600)
This client was only requesting READ caching, not READ and HANDLE caching
in the LeaseState on the open requests we send for directories.  To
delay closing a handle (e.g. for caching directory contents) we should
be requesting HANDLE as well as READ (as we already do for deferred
close of files).   See MS-SMB2 3.3.1.4 e.g.

Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb2ops.c

index 24a2aa04a1086cb67e7be151ca6e2f69d560b164..7571fefeb83aa19d32a44e66b6f9ffe4e526c4c6 100644 (file)
@@ -4080,7 +4080,7 @@ map_oplock_to_lease(u8 oplock)
        if (oplock == SMB2_OPLOCK_LEVEL_EXCLUSIVE)
                return SMB2_LEASE_WRITE_CACHING_LE | SMB2_LEASE_READ_CACHING_LE;
        else if (oplock == SMB2_OPLOCK_LEVEL_II)
-               return SMB2_LEASE_READ_CACHING_LE;
+               return SMB2_LEASE_READ_CACHING_LE | SMB2_LEASE_HANDLE_CACHING_LE;
        else if (oplock == SMB2_OPLOCK_LEVEL_BATCH)
                return SMB2_LEASE_HANDLE_CACHING_LE | SMB2_LEASE_READ_CACHING_LE |
                       SMB2_LEASE_WRITE_CACHING_LE;