Go to file
Gabriel Krisman Bertazi e9b10713e8 fscrypt: Drop d_revalidate once the key is added
When a key is added, existing directory dentries in the
DCACHE_NOKEY_NAME form are moved by the VFS to the plaintext version.
But, since they have the DCACHE_OP_REVALIDATE flag set, revalidation
will be done at each lookup only to return immediately, since plaintext
dentries can't go stale until eviction.  This patch optimizes this case,
by dropping the flag once the nokey_name dentry becomes plain-text.
Note that non-directory dentries are not moved this way, so they won't
be affected.

Of course, this can only be done if fscrypt is the only thing requiring
revalidation for a dentry.  For this reason, we only disable
d_revalidate if the .d_revalidate hook is fscrypt_d_revalidate itself.

It is safe to do it here because when moving the dentry to the
plain-text version, we are holding the d_lock.  We might race with a
concurrent RCU lookup but this is harmless because, at worst, we will
get an extra d_revalidate on the keyed dentry, which will still find the
dentry to be valid.

Finally, now that we do more than just clear the DCACHE_NOKEY_NAME in
fscrypt_handle_d_move, skip it entirely for plaintext dentries, to avoid
extra costs.

Reviewed-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20240221171412.10710-5-krisman@suse.de
Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
2024-02-27 16:55:34 -05:00
Documentation RCU pull request for v6.8 2024-01-12 16:35:58 -08:00
LICENSES LICENSES: Add the copyleft-next-0.3.1 license 2022-11-08 15:44:01 +01:00
arch fbdev fixes and cleanups for 6.8-rc1: 2024-01-12 14:38:08 -08:00
block for-6.8/block-2024-01-08 2024-01-11 13:58:04 -08:00
certs This update includes the following changes: 2023-11-02 16:15:30 -10:00
crypto crypto: scomp - fix req->dst buffer overflow 2023-12-29 11:25:56 +08:00
drivers Devicetree for v6.8: 2024-01-12 15:05:30 -08:00
fs fscrypt: Factor out a helper to configure the lookup dentry 2024-02-27 16:55:34 -05:00
include fscrypt: Drop d_revalidate once the key is added 2024-02-27 16:55:34 -05:00
init header cleanups for 6.8 2024-01-10 16:43:55 -08:00
io_uring for-6.8/io_uring-2024-01-08 2024-01-11 14:19:23 -08:00
ipc shm: Slim down dependencies 2023-12-20 19:26:31 -05:00
kernel RCU pull request for v6.8 2024-01-12 16:35:58 -08:00
lib Networking changes for 6.8. 2024-01-11 10:07:29 -08:00
mm Networking changes for 6.8. 2024-01-11 10:07:29 -08:00
net for-6.8/io_uring-2024-01-08 2024-01-11 14:19:23 -08:00
rust Rust changes for v6.8 2024-01-11 13:05:41 -08:00
samples media updates for v6.8-rc1 2024-01-12 14:29:48 -08:00
scripts Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
security misc cleanups (the part that hadn't been picked by individual fs trees) 2024-01-11 20:23:50 -08:00
sound sound updates for 6.8-rc1 2024-01-12 11:55:28 -08:00
tools RCU pull request for v6.8 2024-01-12 16:35:58 -08:00
usr usr/Kconfig: fix typos of "its" 2023-12-20 15:02:58 -08:00
virt vfs-6.8.misc 2024-01-08 10:26:08 -08:00
.clang-format clang-format: Update with v6.7-rc4's `for_each` macro list 2023-12-08 23:54:38 +01:00
.cocciconfig
.get_maintainer.ignore
.gitattributes .gitattributes: set diff driver for Rust source code files 2023-05-31 17:48:25 +02:00
.gitignore kbuild: rpm-pkg: generate kernel.spec in rpmbuild/SPECS/ 2023-10-03 20:49:09 +09:00
.mailmap Networking changes for 6.8. 2024-01-11 10:07:29 -08:00
.rustfmt.toml
COPYING
CREDITS Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
Kbuild Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Kconfig
MAINTAINERS pwm: Changes for v6.8-rc1 2024-01-12 14:59:50 -08:00
Makefile Quite a lot of kexec work this time around. Many singleton patches in 2024-01-09 11:46:20 -08:00
README

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.