linux/fs/kernfs
Ian Kent 92b57842f4 kernfs: dont take i_lock on revalidate
In kernfs_dop_revalidate() when the passed in dentry is negative the
dentry directory is checked to see if it has changed and if so the
negative dentry is discarded so it can refreshed. During this check
the dentry inode i_lock is taken to mitigate against a possible
concurrent rename.

But if it's racing with a rename, becuase the dentry is negative, it
can't be the source it must be the target and it must be going to do
a d_move() otherwise the rename will return an error.

In this case the parent dentry of the target will not change, it will
be the same over the d_move(), only the source dentry parent may change
so the inode i_lock isn't needed.

Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Ian Kent <raven@themaw.net>
Link: https://lore.kernel.org/r/166606036967.13363.9336408133975631967.stgit@donald.themaw.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-10-20 13:54:31 +02:00
..
dir.c kernfs: dont take i_lock on revalidate 2022-10-20 13:54:31 +02:00
file.c kernfs: Skip kernfs_drain_open_files() more aggressively 2022-09-01 18:08:44 +02:00
inode.c kernfs: dont take i_lock on inode attr read 2022-10-20 13:54:26 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
kernfs-internal.h kernfs: Skip kernfs_drain_open_files() more aggressively 2022-09-01 18:08:44 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
mount.c kernfs: Replace global kernfs_open_file_mutex with hashed mutexes. 2022-06-27 16:46:15 +02:00
symlink.c kernfs: switch global kernfs_rwsem lock to per-fs lock 2021-11-24 13:55:16 +01:00