linux-stable/fs/smb
Meetakshi Setiya 1e60bc0e95 smb: client: retry compound request without reusing lease
[ Upstream commit 71f15c90e7 ]

There is a shortcoming in the current implementation of the file
lease mechanism exposed when the lease keys were attempted to be
reused for unlink, rename and set_path_size operations for a client. As
per MS-SMB2, lease keys are associated with the file name. Linux smb
client maintains lease keys with the inode. If the file has any hardlinks,
it is possible that the lease for a file be wrongly reused for an
operation on the hardlink or vice versa. In these cases, the mentioned
compound operations fail with STATUS_INVALID_PARAMETER.
This patch adds a fallback to the old mechanism of not sending any
lease with these compound operations if the request with lease key fails
with STATUS_INVALID_PARAMETER.
Resending the same request without lease key should not hurt any
functionality, but might impact performance especially in cases where
the error is not because of the usage of wrong lease key and we might
end up doing an extra roundtrip.

Signed-off-by: Meetakshi Setiya <msetiya@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-05-25 16:22:47 +02:00
..
client smb: client: retry compound request without reusing lease 2024-05-25 16:22:47 +02:00
common Add definition for new smb3.1.1 command type 2024-05-25 16:22:41 +02:00
server ksmbd: Add kernel-doc for ksmbd_extract_sharename() function 2024-05-25 16:22:46 +02:00
Kconfig
Makefile