From: Steve French <stfrench@xxxxxxxxxxxxx> commit 9ed9d83a51a9636d367c796252409e7b2f4de4d4 upstream. 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@xxxxxxxxxxxxxxx Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/smb/client/smb2ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -4078,7 +4078,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; Patches currently in stable-queue which might be from stfrench@xxxxxxxxxxxxx are queue-6.11/smb3-request-handle-caching-when-caching-directories.patch queue-6.11/smb-cached-directories-can-be-more-than-root-file-ha.patch queue-6.11/smb-client-fix-null-ptr-deref-in-crypto_aead_setkey.patch queue-6.11/smb-don-t-leak-cfid-when-reconnect-races-with-open_cached_dir.patch queue-6.11/smb-during-unmount-ensure-all-cached-dir-instances-drop-their-dentry.patch queue-6.11/ksmbd-fix-use-after-free-in-smb-request-handling.patch queue-6.11/smb-client-handle-max-length-for-smb-symlinks.patch queue-6.11/smb-prevent-use-after-free-due-to-open_cached_dir-error-paths.patch queue-6.11/cifs-support-mounting-with-alternate-password-to-allow-password-rotation.patch