[v6.6][PATCH 00/57] eventfs: Linus's updates for 6.6

From: Steven Rostedt
Date: Tue Feb 06 2024 - 07:14:22 EST



This is a backport of all the work that lead up to the work that Linus made
on eventfs. I trust Linus's version more so than the versions in 6.6 and
6.7. There may be plenty of hidden issues due to the design.

This is the update for 6.6. It includes Linus's updates as well as all the
patches leading up to them. As the eventfs work went in in two parts, half
went in in 6.6 and the other in 6.7, there were 6 backports that were done
custom to 6.6 as the bugs found in 6.7 were in 6.6 but implemented
differently. This series starts with reverting those 6 backports and then
applying the updated patches to get to Linus's simplification.

I ran these through my full test suite that I use before sending anything to
Linus, although I did not run my "bisect" test that walks through the
patches. The tests were just run on the end result.

This was created with the following command against v6.6.15, after reverting
the 6 patches:

git log --reverse --no-merges --pretty=oneline v6.6..origin/master fs/tracefs/ | cut -d' ' -f1 |
while read a; do if ! git cherry-pick -x $a; then break; fi ; done

Which adds -x to the cherry pick to add the upstream commit SHAs.

There was one patch in tracefs that didn't need to be backported and I removed
that one.

Beau Belgrave (1):
eventfs: Fix events beyond NAME_MAX blocking tasks

Erick Archer (1):
eventfs: Use kcalloc() instead of kzalloc()

Jiapeng Chong (1):
tracefs/eventfs: Modify mismatched function name

Linus Torvalds (7):
tracefs: remove stale 'update_gid' code
eventfs: Initialize the tracefs inode properly
tracefs: Avoid using the ei->dentry pointer unnecessarily
tracefs: dentry lookup crapectomy
eventfs: Remove unused d_parent pointer field
eventfs: Clean up dentry ops and add revalidate function
eventfs: Get rid of dentry pointers without refcounts

Nathan Chancellor (1):
eventfs: Use ERR_CAST() in eventfs_create_events_dir()

Steven Rostedt (Google) (46):
Revert "eventfs: Do not allow NULL parent to eventfs_start_creating()"
Revert "eventfs: Check for NULL ef in eventfs_set_attr()"
Revert "eventfs: Use simple_recursive_removal() to clean up dentries"
Revert "eventfs: Delete eventfs_inode when the last dentry is freed"
Revert "eventfs: Save ownership and mode"
Revert "eventfs: Remove "is_freed" union with rcu head"
eventfs: Remove eventfs_file and just use eventfs_inode
eventfs: Use eventfs_remove_events_dir()
eventfs: Fix failure path in eventfs_create_events_dir()
eventfs: Fix WARN_ON() in create_file_dentry()
eventfs: Fix typo in eventfs_inode union comment
eventfs: Remove extra dget() in eventfs_create_events_dir()
eventfs: Fix kerneldoc of eventfs_remove_rec()
eventfs: Remove "is_freed" union with rcu head
eventfs: Have a free_ei() that just frees the eventfs_inode
eventfs: Test for ei->is_freed when accessing ei->dentry
eventfs: Save ownership and mode
eventfs: Hold eventfs_mutex when calling callback functions
eventfs: Delete eventfs_inode when the last dentry is freed
eventfs: Remove special processing of dput() of events directory
eventfs: Use simple_recursive_removal() to clean up dentries
eventfs: Remove expectation that ei->is_freed means ei->dentry == NULL
eventfs: Do not invalidate dentry in create_file/dir_dentry()
eventfs: Use GFP_NOFS for allocation when eventfs_mutex is held
eventfs: Move taking of inode_lock into dcache_dir_open_wrapper()
eventfs: Do not allow NULL parent to eventfs_start_creating()
eventfs: Make sure that parent->d_inode is locked in creating files/dirs
eventfs: Have event files and directories default to parent uid and gid
eventfs: Fix file and directory uid and gid ownership
tracefs: Check for dentry->d_inode exists in set_gid()
eventfs: Fix bitwise fields for "is_events"
eventfs: Remove "lookup" parameter from create_dir/file_dentry()
eventfs: Stop using dcache_readdir() for getdents()
tracefs/eventfs: Use root and instance inodes as default ownership
eventfs: Have eventfs_iterate() stop immediately if ei->is_freed is set
eventfs: Do ctx->pos update for all iterations in eventfs_iterate()
eventfs: Read ei->entries before ei->children in eventfs_iterate()
eventfs: Shortcut eventfs_iterate() by skipping entries already read
eventfs: Have the inodes all for files and directories all be the same
eventfs: Do not create dentries nor inodes in iterate_shared
eventfs: Save directory inodes in the eventfs_inode structure
tracefs: Zero out the tracefs_inode when allocating it
eventfs: Warn if an eventfs_inode is freed without is_freed being set
eventfs: Restructure eventfs_inode structure to be more condensed
eventfs: Remove fsnotify*() functions from lookup()
eventfs: Keep all directory links at 1

----
fs/tracefs/event_inode.c | 1250 +++++++++++++++++++-----------------------
fs/tracefs/inode.c | 276 +++++-----
fs/tracefs/internal.h | 60 +-
include/linux/trace_events.h | 2 +-
include/linux/tracefs.h | 73 ++-
kernel/trace/trace.c | 7 +-
kernel/trace/trace.h | 4 +-
kernel/trace/trace_events.c | 311 +++++++----
8 files changed, 1029 insertions(+), 954 deletions(-)