Skip to content

Commit 7fbe643

Browse files
hac-vgregkh
authored andcommitted
smb: client: disable directory caching when dir_cache_timeout is zero
[ Upstream commit ceaf145 ] 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: 238b351 ("smb3: allow controlling length of time directory entries are cached with dir leases") Reviewed-by: Paulo Alcantara (Red Hat) <[email protected]> Reviewed-by: Enzo Matsumiya <[email protected]> Signed-off-by: Henrique Carvalho <[email protected]> Signed-off-by: Steve French <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 6e7724e commit 7fbe643

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/smb/client/connect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2594,7 +2594,7 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb3_fs_context *ctx)
25942594

25952595
if (ses->server->dialect >= SMB20_PROT_ID &&
25962596
(ses->server->capabilities & SMB2_GLOBAL_CAP_DIRECTORY_LEASING))
2597-
nohandlecache = ctx->nohandlecache;
2597+
nohandlecache = ctx->nohandlecache || !dir_cache_timeout;
25982598
else
25992599
nohandlecache = true;
26002600
tcon = tcon_info_alloc(!nohandlecache, netfs_trace_tcon_ref_new);

0 commit comments

Comments
 (0)