2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/fs/ecryptfs
NeilBrown fa6fe07d15
VFS: rename lookup_one_len family to lookup_noperm and remove permission check
The lookup_one_len family of functions is (now) only used internally by
a filesystem on itself either
- in a context where permission checking is irrelevant such as by a
  virtual filesystem populating itself, or xfs accessing its ORPHANAGE
  or dquota accessing the quota file; or
- in a context where a permission check (MAY_EXEC on the parent) has just
  been performed such as a network filesystem finding in "silly-rename"
  file in the same directory.  This is also the context after the
  _parentat() functions where currently lookup_one_qstr_excl() is used.

So the permission check is pointless.

The name "one_len" is unhelpful in understanding the purpose of these
functions and should be changed.  Most of the callers pass the len as
"strlen()" so using a qstr and QSTR() can simplify the code.

This patch renames these functions (include lookup_positive_unlocked()
which is part of the family despite the name) to have a name based on
"lookup_noperm".  They are changed to receive a 'struct qstr' instead
of separate name and len.  In a few cases the use of QSTR() results in a
new call to strlen().

try_lookup_noperm() takes a pointer to a qstr instead of the whole
qstr.  This is consistent with d_hash_and_lookup() (which is nearly
identical) and useful for lookup_noperm_unlocked().

The new lookup_noperm_common() doesn't take a qstr yet.  That will be
tidied up in a subsequent patch.

Signed-off-by: NeilBrown <neil@brown.name>
Link: https://lore.kernel.org/r/20250319031545.2999807-5-neil@brown.name
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-04-08 11:24:36 +02:00
..
crypto.c ecryptfs: Pass the folio index to crypt_extent() 2024-11-05 17:20:00 +01:00
debug.c ecryptfs: debug: Demote a couple of kernel-doc abuses 2021-04-19 04:42:13 +00:00
dentry.c Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
ecryptfs_kernel.h ecryptfs: Convert ecryptfs to use the new mount API 2024-11-15 11:50:13 +01:00
file.c splice: Use filemap_splice_read() instead of generic_file_splice_read() 2023-05-24 08:42:17 -06:00
inode.c VFS: rename lookup_one_len family to lookup_noperm and remove permission check 2025-04-08 11:24:36 +02:00
Kconfig docs: filesystems: fix renamed references 2020-04-20 15:45:22 -06:00
keystore.c ecryptfs: Fix buffer size for tag 66 packet 2024-04-05 15:53:46 +02:00
kthread.c ecryptfs: kthread: Demote file header and provide description for 'cred' 2021-04-19 04:42:13 +00:00
main.c ecryptfs: Fix spelling mistake "validationg" -> "validating" 2024-11-15 11:51:29 +01:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
messaging.c eCryptfs: Use DEFINE_MUTEX() for mutex lock 2021-04-19 04:42:13 +00:00
miscdev.c ecryptfs: miscdev: File headers are not good kernel-doc candidates 2021-04-19 04:42:13 +00:00
mmap.c ecryptfs: Convert ecryptfs_decrypt_page() to take a folio 2024-11-05 17:20:00 +01:00
read_write.c ecryptfs: Convert ecryptfs_encrypt_page() to take a folio 2024-11-05 17:19:59 +01:00
super.c ecryptfs: remove NULL remount_fs from super_operations 2025-03-01 11:02:36 +01:00