]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cifs: fix dentry lookups in directory handle cache
authorPaulo Alcantara <pc@manguebit.com>
Fri, 24 Mar 2023 16:56:33 +0000 (13:56 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Mar 2023 10:49:21 +0000 (12:49 +0200)
commit362628048710b9eb1374d38a42c94098ba40bf3e
treeeb4bb5c3b6ee698c68cab0765ce841b355451029
parentd4bab65f80cefda01b1f9b6c7a22db139187705d
cifs: fix dentry lookups in directory handle cache

commit be4fde79812f02914e350bde0bc4cfeae8429378 upstream.

Get rid of any prefix paths in @path before lookup_positive_unlocked()
as it will call ->lookup() which already adds those prefix paths
through build_path_from_dentry().

This has caused a performance regression when mounting shares with a
prefix path where readdir(2) would end up retrying several times to
open bad directory names that contained duplicate prefix paths.

Fix this by skipping any prefix paths in @path before calling
lookup_positive_unlocked().

Fixes: e4029e072673 ("cifs: find and use the dentry for cached non-root directories also")
Cc: stable@vger.kernel.org # 6.1+
Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/cached_dir.c