Skip to content

Commit ceaf145

Browse files
decarvSteve French
authored andcommitted
smb: client: disable directory caching when dir_cache_timeout is zero
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]>
1 parent f6e8883 commit ceaf145

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/smb/client/connect.c

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

25722572
if (ses->server->dialect >= SMB20_PROT_ID &&
25732573
(ses->server->capabilities & SMB2_GLOBAL_CAP_DIRECTORY_LEASING))
2574-
nohandlecache = ctx->nohandlecache;
2574+
nohandlecache = ctx->nohandlecache || !dir_cache_timeout;
25752575
else
25762576
nohandlecache = true;
25772577
tcon = tcon_info_alloc(!nohandlecache, netfs_trace_tcon_ref_new);

0 commit comments

Comments
 (0)