linux/include
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
..
acpi misc: Constify amba_id table 2025-03-29 18:25:34 -07:00
asm-generic RISC-V Patches for the 6.15 Merge Window, Part 1 2025-04-04 09:49:17 -07:00
clocksource
crypto This update includes the following changes: 2025-03-29 10:01:55 -07:00
cxl cxl for v6.15 2025-04-02 20:04:43 -07:00
drm Rust changes for v6.15 2025-03-30 17:03:26 -07:00
dt-bindings Char/Misc/IIO driver updates for 6.15-rc1 2025-04-01 11:26:08 -07:00
hyperv x86/hyperv: Add comments about hv_vpset and var size hypercall input args 2025-03-21 18:24:22 +00:00
keys
kunit
kvm Merge branch 'kvm-arm64/pmu-fixes' into kvmarm/next 2025-03-19 14:54:52 -07:00
linux VFS: rename lookup_one_len family to lookup_noperm and remove permission check 2025-04-08 11:24:36 +02:00
math-emu
media
memory
misc
net treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
pcmcia
ras
rdma RDMA/core: Pass port to counter bind/unbind operations 2025-03-18 06:18:46 -04:00
rv
scsi
soc soc: driver updates for 6.15, part 1 2025-03-27 09:05:55 -07:00
sound soundwire updates for 6.15 2025-04-01 12:43:13 -07:00
target
trace tracing/timers: Rename the hrtimer_init event to hrtimer_setup 2025-04-05 10:30:17 +02:00
uapi io_uring-6.15-20250403 2025-04-03 15:48:58 -07:00
ufs
vdso
video
xen
Kbuild