]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
eventfs: Do not invalidate dentry in create_file/dir_dentry()
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 6 Feb 2024 12:09:30 +0000 (07:09 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 08:25:21 +0000 (09:25 +0100)
commit7b4cb5d59f3e8d31315d82f76c7313deea5ac8a2
tree1a4f064f3d51bc5fd55bfa890317cfb38379f9eb
parentb1391e3653f55b7693b2948652daf39c5289445c
eventfs: Do not invalidate dentry in create_file/dir_dentry()

commit 71cade82f2b553a74d046c015c986f2df165696f upstream.

With the call to simple_recursive_removal() on the entire eventfs sub
system when the directory is removed, it performs the d_invalidate on all
the dentries when it is removed. There's no need to do clean ups when a
dentry is being created while the directory is being deleted.

As dentries are cleaned up by the simpler_recursive_removal(), trying to
do d_invalidate() in these functions will cause the dentry to be
invalidated twice, and crash the kernel.

Link: https://lore.kernel.org/all/20231116123016.140576-1-naresh.kamboju@linaro.org/
Link: https://lkml.kernel.org/r/20231120235154.422970988@goodmis.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Fixes: 407c6726ca71 ("eventfs: Use simple_recursive_removal() to clean up dentries")
Reported-by: Mark Rutland <mark.rutland@arm.com>
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/tracefs/event_inode.c