linux/fs
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
..
9p Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
adfs
affs
afs Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
autofs
bcachefs - The series "resource: A couple of cleanups" from Andy Shevchenko 2024-11-25 16:09:48 -08:00
befs
bfs
btrfs cxl changes for v6.13 2024-11-22 12:33:52 -08:00
cachefiles cachefiles: Fix NULL pointer dereference in object->file 2024-11-11 14:39:38 +01:00
ceph Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
coda Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
configfs configfs: improve item creation performance 2024-11-14 07:45:20 +01:00
cramfs
crypto Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
debugfs
devpts
dlm dlm: fix dlm_recover_members refcount on error 2024-11-18 10:05:57 -06:00
ecryptfs Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
efivarfs
efs
erofs erofs: handle NONHEAD !delta[1] lclusters gracefully 2024-11-18 18:50:14 +08:00
exfat Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
exportfs fs: prepare for "explicit connectable" file handles 2024-11-15 11:34:57 +01:00
ext2
ext4 ext4 fast_commit: make use of name_snapshot primitives 2025-01-27 19:24:43 -05:00
f2fs f2fs-for-6.13-rc1 2024-11-26 12:50:58 -08:00
fat Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
freevxfs freevxfs: Replace one-element array with flexible array member 2024-11-06 10:42:06 +01:00
fuse Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
gfs2 Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
hfs Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
hfsplus vfs-6.13.misc 2024-11-18 09:35:30 -08:00
hostfs hostfs: Fix the NULL vs IS_ERR() bug for __filemap_get_folio() 2024-11-15 20:55:32 +01:00
hpfs
hugetlbfs - The series "zram: optimal post-processing target selection" from 2024-11-23 09:58:07 -08:00
iomap Merge branch 'ovl.fixes' 2024-11-26 18:15:06 +01:00
isofs isofs: avoid memory leak in iocharset 2024-11-06 20:24:41 +01:00
jbd2 jbd2: Fix comment describing journal_init_common() 2024-11-13 12:56:48 -05:00
jffs2 jffs2: Prevent rtime decompress memory corruption 2024-11-14 20:56:19 +01:00
jfs Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
kernfs Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
lockd NFSD 6.13 Release Notes 2024-11-26 12:59:30 -08:00
minix
netfs fscache: Remove duplicate included header 2024-11-21 09:35:25 +01:00
nfs Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
nfs_common nfs_common: must not hold RCU while calling nfsd_file_put_local 2024-11-18 20:23:12 -05:00
nfsd NFSD 6.13 Release Notes 2024-11-26 12:59:30 -08:00
nilfs2 - The series "resource: A couple of cleanups" from Andy Shevchenko 2024-11-25 16:09:48 -08:00
nls
notify \n 2024-11-21 09:55:45 -08:00
ntfs3
ocfs2 Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
omfs
openpromfs
orangefs Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
overlayfs Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
proc Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
pstore
qnx4
qnx6
quota \n 2024-11-21 09:50:18 -08:00
ramfs
romfs
smb Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
squashfs
sysfs
sysv
tests
tracefs Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
ubifs This pull request contains updates for JFFS2, UBI and UBIFS: 2024-11-30 10:32:47 -08:00
udf
ufs ufs: ufs_sb_private_info: remove unused s_{2,3}apb fields 2024-11-12 19:02:12 -05:00
unicode unicode updates 2024-11-22 20:50:55 -08:00
vboxsf Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
verity
xfs - The series "zram: optimal post-processing target selection" from 2024-11-23 09:58:07 -08:00
zonefs
aio.c A rather large update for timekeeping and timers: 2024-11-19 16:35:06 -08:00
anon_inodes.c
attr.c
backing-file.c fs/backing_file: fix wrong argument in callback 2024-11-26 18:13:29 +01:00
bad_inode.c
binfmt_elf.c Revert "fs: don't block i_writecount during exec" 2024-11-27 12:51:30 +01:00
binfmt_elf_fdpic.c Revert "fs: don't block i_writecount during exec" 2024-11-27 12:51:30 +01:00
binfmt_flat.c
binfmt_misc.c Revert "fs: don't block i_writecount during exec" 2024-11-27 12:51:30 +01:00
binfmt_script.c
bpf_fs_kfuncs.c
buffer.c - The series "zram: optimal post-processing target selection" from 2024-11-23 09:58:07 -08:00
char_dev.c
compat_binfmt_elf.c
coredump.c
d_path.c
dax.c
dcache.c dissolve external_name.u into separate members 2025-01-27 19:17:22 -05:00
direct-io.c
drop_caches.c
eventfd.c
eventpoll.c Networking changes for 6.13. 2024-11-21 08:28:08 -08:00
exec.c Revert "fs: don't block i_writecount during exec" 2024-11-27 12:51:30 +01:00
fcntl.c fs: require inode_owner_or_capable for F_SET_RW_HINT 2024-11-25 15:16:49 +01:00
fhandle.c vfs-6.13.exportfs 2024-11-26 13:26:15 -08:00
file.c vfs-6.13.file 2024-11-18 10:30:29 -08:00
file_table.c
filesystems.c
fs-writeback.c Merge patch series "two little writeback cleanups v2" 2024-11-13 14:08:34 +01:00
fs_context.c
fs_parser.c vfs-6.13.ovl 2024-11-18 10:45:06 -08:00
fs_pin.c
fs_struct.c
fs_types.c
fsopen.c
init.c
inode.c - The series "zram: optimal post-processing target selection" from 2024-11-23 09:58:07 -08:00
internal.h sanitize struct filename and lookup flags handling in statx 2024-11-18 14:54:10 -08:00
ioctl.c
Kconfig
Kconfig.binfmt
kernel_read_file.c
libfs.c generic_ci_d_compare(): use shortname_storage 2025-01-27 19:24:43 -05:00
locks.c
Makefile
mbcache.c
mnt_idmapping.c
mount.h
mpage.c
namei.c Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
namespace.c statmount: fix security option retrieval 2024-11-21 09:35:31 +01:00
nsfs.c
open.c \n 2024-11-21 09:55:45 -08:00
pidfs.c
pipe.c
pnode.c
pnode.h
posix_acl.c
proc_namespace.c
read_write.c the bulk of struct fd memory safety stuff 2024-11-18 12:24:06 -08:00
readdir.c
remap_range.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c sanitize struct filename and lookup flags handling in statx 2024-11-18 14:54:10 -08:00
statfs.c
super.c
sync.c
sysctls.c
timerfd.c A rather large update for timekeeping and timers: 2024-11-19 16:35:06 -08:00
userfaultfd.c
utimes.c
xattr.c xattr: remove redundant check on variable err 2024-11-06 13:00:01 -05:00