linux-stable/fs/kernfs
Al Viro 3c70569e17 new helper: lookup_positive_unlocked()
[ Upstream commit 6c2d4798a8 ]

Most of the callers of lookup_one_len_unlocked() treat negatives are
ERR_PTR(-ENOENT).  Provide a helper that would do just that.  Note
that a pinned positive dentry remains positive - it's ->d_inode is
stable, etc.; a pinned _negative_ dentry can become positive at any
point as long as you are not holding its parent at least shared.
So using lookup_one_len_unlocked() needs to be careful;
lookup_positive_unlocked() is safer and that's what the callers
end up open-coding anyway.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Stable-dep-of: 0d5a4f8f77 ("fs: Fix error checking for d_hash_and_lookup()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-23 10:47:59 +02:00
..
Kconfig
Makefile
dir.c kernfs: fix use-after-free in __kernfs_remove 2022-11-03 23:52:29 +09:00
file.c kernfs: allow creating kernfs objects with arbitrary uid/gid 2018-07-20 23:44:35 -07:00
inode.c kernfs: allow creating kernfs objects with arbitrary uid/gid 2018-07-20 23:44:35 -07:00
kernfs-internal.h kernfs: allow creating kernfs objects with arbitrary uid/gid 2018-07-20 23:44:35 -07:00
mount.c new helper: lookup_positive_unlocked() 2023-09-23 10:47:59 +02:00
symlink.c kernfs: Fix range checks in kernfs_get_target_path 2019-11-20 18:46:47 +01:00