mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
smb: client: disable directory caching when dir_cache_timeout is zero
[ Upstream commitceaf145199
] Setting dir_cache_timeout to zero should disable the caching of directory contents. Currently, even when dir_cache_timeout is zero, some caching related functions are still invoked, which is unintended behavior. Fix the issue by setting tcon->nohandlecache to true when dir_cache_timeout is zero, ensuring that directory handle caching is properly disabled. Fixes:238b351d09
("smb3: allow controlling length of time directory entries are cached with dir leases") Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.com> Reviewed-by: Enzo Matsumiya <ematsumiya@suse.de> Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
6e7724e319
commit
7fbe643b56
@ -2594,7 +2594,7 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb3_fs_context *ctx)
|
||||
|
||||
if (ses->server->dialect >= SMB20_PROT_ID &&
|
||||
(ses->server->capabilities & SMB2_GLOBAL_CAP_DIRECTORY_LEASING))
|
||||
nohandlecache = ctx->nohandlecache;
|
||||
nohandlecache = ctx->nohandlecache || !dir_cache_timeout;
|
||||
else
|
||||
nohandlecache = true;
|
||||
tcon = tcon_info_alloc(!nohandlecache, netfs_trace_tcon_ref_new);
|
||||
|
Loading…
Reference in New Issue
Block a user