]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
smb: client: short-circuit in open_cached_dir_by_dentry() if !dentry
authorHenrique Carvalho <henrique.carvalho@suse.com>
Thu, 18 Sep 2025 21:39:51 +0000 (18:39 -0300)
committerSteve French <stfrench@microsoft.com>
Thu, 2 Oct 2025 03:42:15 +0000 (22:42 -0500)
commit55580ad027a6764b7b1ee75f537d67811a06307f
tree3d19dd2154a23fc569f9f63d93b668130bf1e1aa
parent2f6a4af028dbb392d55b261cafcb922dd7b7ffea
smb: client: short-circuit in open_cached_dir_by_dentry() if !dentry

When dentry is NULL, the current code acquires the spinlock and traverses
the entire list, but the condition (dentry && cfid->dentry == dentry)
ensures no match will ever be found.

Return -ENOENT early in this case, avoiding unnecessary lock acquisition
and list traversal.

Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cached_dir.c