]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
make it easier to catch those who try to modify ->d_name
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 9 Feb 2024 19:57:43 +0000 (14:57 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 16 Sep 2025 01:08:33 +0000 (21:08 -0400)
commit180a9cc3fd6a020746fbd7f97b9b62295a325fd2
tree8532935589ae9bdb08fca6ac73b27a505463bcbd
parentca97d6c60b1d1dff519a7e3dd86708304e657365
make it easier to catch those who try to modify ->d_name

Turn d_name into an anon union of const struct qstr d_name with
struct qstr __d_name.  Very few places need to modify it (all
in fs/dcache.c); those are switched to use of ->__d_name.

Note that ->d_name can actually change under you unless you have
the right locking environment; this const just prohibits accidentally
doing stores without being easily spotted.

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/dcache.c
include/linux/dcache.h