mirror-linux/Documentation
Al Viro 5be1fa8abd Pass parent directory inode and expected name to ->d_revalidate()
->d_revalidate() often needs to access dentry parent and name; that has
to be done carefully, since the locking environment varies from caller
to caller.  We are not guaranteed that dentry in question will not be
moved right under us - not unless the filesystem is such that nothing
on it ever gets renamed.

It can be dealt with, but that results in boilerplate code that isn't
even needed - the callers normally have just found the dentry via dcache
lookup and want to verify that it's in the right place; they already
have the values of ->d_parent and ->d_name stable.  There is a couple
of exceptions (overlayfs and, to less extent, ecryptfs), but for the
majority of calls that song and dance is not needed at all.

It's easier to make ecryptfs and overlayfs find and pass those values if
there's a ->d_revalidate() instance to be called, rather than doing that
in the instances.

This commit only changes the calling conventions; making use of supplied
values is left to followups.

NOTE: some instances need more than just the parent - things like CIFS
may need to build an entire path from filesystem root, so they need
more precautions than the usual boilerplate.  This series doesn't
do anything to that need - these filesystems have to keep their locking
mechanisms (rename_lock loops, use of dentry_path_raw(), private rwsem
a-la v9fs).

One thing to keep in mind when using name is that name->name will normally
point into the pathname being resolved; the filename in question occupies
name->len bytes starting at name->name, and there is NUL somewhere after it,
but it the next byte might very well be '/' rather than '\0'.  Do not
ignore name->len.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Gabriel Krisman Bertazi <gabriel@krisman.be>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2025-01-27 19:25:23 -05:00
..
ABI Char/Misc/IIO/Whatever driver subsystem updates for 6.13-rc1 2024-11-29 11:58:27 -08:00
PCI Merge branch 'pci/endpoint' 2024-11-25 13:40:56 -06:00
RCU doc: rcu: update printed dynticks counter bits 2024-11-12 21:40:24 +01:00
accel
accounting
admin-guide * Features 2024-11-29 11:10:30 -08:00
arch - Move the ->select callback to the correct ops structure in irq-mvebu-sei to 2024-12-01 12:37:58 -08:00
block
bpf bpf: Remove trailing whitespace in verifier.rst 2024-11-11 08:17:48 -08:00
cdrom
core-api A few late-arriving fixes, plus two more significant changes that were 2024-11-26 13:44:27 -08:00
cpu-freq
crypto
dev-tools Kbuild updates for v6.13 2024-11-30 13:41:50 -08:00
devicetree ARM: 2024-11-30 14:51:08 -08:00
doc-guide Documentation: kernel-doc: enumerate identifier *type*s 2024-11-22 10:37:40 -07:00
driver-api Driver core changes for 6.13-rc1 2024-11-29 11:43:29 -08:00
fault-injection net: Implement fault injection forcing skb reallocation 2024-11-12 12:05:33 +01:00
fb
features riscv: Add qspinlock support 2024-11-11 07:33:20 -08:00
filesystems Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
firmware-guide
firmware_class
fpga
gpu drm/amdgpu: Add documentation for enforce isolation feature 2024-11-08 11:45:29 -05:00
hid
hwmon hwmon: (tmp108) Add NXP p3t1085 support 2024-11-12 13:54:55 -08:00
i2c i2c-host updates for v6.13, part 1 2024-11-18 08:35:47 +01:00
iio docs: iio: ad7380: add adaq4370-4 and adaq4380-4 2024-11-09 10:42:03 +00:00
images
infiniband
input Input: fix the input_event struct documentation 2024-11-14 18:03:23 -08:00
isdn
kbuild Kbuild updates for v6.13 2024-11-30 13:41:50 -08:00
kernel-hacking docs/licensing: Clarify wording about "GPL" and "Proprietary" 2024-11-22 10:44:25 -07:00
leds
litmus-tests
livepatch
locking locking/Documentation: Fix grammar in percpu-rw-semaphore.rst 2024-11-13 10:59:01 +01:00
maintainer
mhi
misc-devices
mm slab updates for 6.13 2024-11-25 16:51:24 -08:00
netlabel
netlink net: Add napi_struct parameter irq_suspend_timeout 2024-11-11 18:45:05 -08:00
networking Documentation: tls_offload: fix typos and grammar 2024-11-28 12:09:06 +01:00
nvdimm
nvme
pcmcia
peci
power
process A few late-arriving fixes, plus two more significant changes that were 2024-11-26 13:44:27 -08:00
rust Rust changes for v6.13 2024-11-26 14:00:26 -08:00
scheduler sched_ext: Rename scx_bpf_consume() to scx_bpf_dsq_move_to_local() 2024-11-11 07:06:16 -10:00
scsi
security
sound ASoC: Fixes for v6.13 2024-11-28 14:55:21 +01:00
sphinx
sphinx-static
spi
staging
target
tee
timers
tools
trace tracing: Record task flag NEED_RESCHED_LAZY. 2024-11-22 17:49:39 -05:00
translations The biggest change here is eliminating the awful idea that KVM had, of 2024-11-23 16:00:50 -08:00
usb
userspace-api drm for 6.13-rc1 2024-11-21 14:56:17 -08:00
virt The biggest change here is eliminating the awful idea that KVM had, of 2024-11-23 16:00:50 -08:00
w1
watchdog
wmi platform-drivers-x86 for v6.13-1 2024-11-20 14:07:55 -08:00
.gitignore
Changes
CodingStyle
Kconfig
Makefile
SubmittingPatches
atomic_bitops.txt
atomic_t.txt
conf.py
docutils.conf
index.rst
memory-barriers.txt
subsystem-apis.rst