Use try_lookup_noperm() instead of d_hash_and_lookup() outside of VFS
authorNeilBrown <neilb@suse.de>
Wed, 19 Mar 2025 03:01:36 +0000 (14:01 +1100)
committerChristian Brauner <brauner@kernel.org>
Tue, 8 Apr 2025 09:24:41 +0000 (11:24 +0200)
commit06c567403ae5a0b56005c2d4a184c903f572c844
tree2240053af127cf0a802a5b05e805c5bea4ec6daf
parentfa6fe07d1536361a227d655e69ca270faf28fdbe
Use try_lookup_noperm() instead of d_hash_and_lookup() outside of VFS

try_lookup_noperm() and d_hash_and_lookup() are nearly identical.  The
former does some validation of the name where the latter doesn't.
Outside of the VFS that validation is likely valuable, and having only
one exported function for this task is certainly a good idea.

So make d_hash_and_lookup() local to VFS files and change all other
callers to try_lookup_noperm().  Note that the arguments are swapped.

Signed-off-by: NeilBrown <neilb@suse.de>
Link: https://lore.kernel.org/r/20250319031545.2999807-6-neil@brown.name
Signed-off-by: Christian Brauner <brauner@kernel.org>
Documentation/filesystems/porting.rst
fs/dcache.c
fs/efivarfs/super.c
fs/internal.h
fs/proc/base.c
fs/smb/client/readdir.c
fs/xfs/scrub/orphanage.c
include/linux/dcache.h
net/sunrpc/rpc_pipe.c
security/selinux/selinuxfs.c