linux-stable/fs/tracefs
Steven Rostedt (Google) 055907ad2c eventfs: Use simple_recursive_removal() to clean up dentries
commit 407c6726ca upstream

Looking at how dentry is removed via the tracefs system, I found that
eventfs does not do everything that it did under tracefs. The tracefs
removal of a dentry calls simple_recursive_removal() that does a lot more
than a simple d_invalidate().

As it should be a requirement that any eventfs_inode that has a dentry, so
does its parent. When removing a eventfs_inode, if it has a dentry, a call
to simple_recursive_removal() on that dentry should clean up all the
dentries underneath it.

Add WARN_ON_ONCE() to check for the parent having a dentry if any children
do.

Link: https://lore.kernel.org/all/20231101022553.GE1957730@ZenIV/
Link: https://lkml.kernel.org/r/20231101172650.552471568@goodmis.org

Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Fixes: 5bdcd5f533 ("eventfs: Implement removal of meta data from eventfs")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-08 11:56:21 +01:00
..
event_inode.c eventfs: Use simple_recursive_removal() to clean up dentries 2023-11-08 11:56:21 +01:00
inode.c tracefs/eventfs: Use dput to free the toplevel events directory 2023-09-07 16:04:47 -04:00
internal.h tracefs/eventfs: Use dput to free the toplevel events directory 2023-09-07 16:04:47 -04:00
Makefile eventfs: Implement eventfs dir creation functions 2023-07-30 18:13:33 -04:00