]> git.hungrycats.org Git - linux/commit
smb: client: disable directory caching when dir_cache_timeout is zero
authorHenrique Carvalho <henrique.carvalho@suse.com>
Sat, 23 Nov 2024 01:14:35 +0000 (22:14 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 12:54:30 +0000 (13:54 +0100)
commit5048efee33592c421d860f55eea9d7782e1ef930
treed6cae5202cf4d6cc3f4b62c280c42aa77df8d7cb
parentb7ed8eba0c71ada4d0f94892590a6470d7fb4a96
smb: client: disable directory caching when dir_cache_timeout is zero

[ Upstream commit ceaf1451990e3ea7fb50aebb5a149f57945f6e9f ]

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: 238b351d0935 ("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>
fs/smb/client/connect.c