linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/7] eventfs: Fixing dynamic creation
@ 2023-10-31 22:33 Steven Rostedt
  2023-10-31 22:33 ` [PATCH v5 1/7] eventfs: Remove "is_freed" union with rcu head Steven Rostedt
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Steven Rostedt @ 2023-10-31 22:33 UTC (permalink / raw)
  To: linux-kernel, linux-trace-kernel
  Cc: Masami Hiramatsu, Mark Rutland, Ajay Kaher, Andrew Morton

I found an issue with using a union between the rcu list head and
the "is_freed" boolean (word). That is, rcu list is a single link
list where the last element has a NULL pointer. That means, if
the eventfs_inode is the last element (which it likely will be)
it will not have its flag set to is_free.

Instead use a bit from nr_entries to be the is_freed flag.

Changes since v4: https://lore.kernel.org/linux-trace-kernel/20231031193109.018322397@goodmis.org/

- Updated on top of the change to separate out is_freed from the union

- Add another fix to only delete the eventfs_inode after the last
  dentry has cleared its reference (there's more races there without
  doing that)

- Make the top level eventfs directory the same as the rest in
  being removed.

Steven Rostedt (Google) (7):
      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

----
 fs/tracefs/event_inode.c | 431 +++++++++++++++++++++++++++++++----------------
 fs/tracefs/internal.h    |  27 ++-
 include/linux/tracefs.h  |  43 +++++
 3 files changed, 353 insertions(+), 148 deletions(-)

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-11-01 23:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-31 22:33 [PATCH v5 0/7] eventfs: Fixing dynamic creation Steven Rostedt
2023-10-31 22:33 ` [PATCH v5 1/7] eventfs: Remove "is_freed" union with rcu head Steven Rostedt
2023-11-01 12:19   ` Masami Hiramatsu
2023-10-31 22:33 ` [PATCH v5 2/7] eventfs: Have a free_ei() that just frees the eventfs_inode Steven Rostedt
2023-11-01 12:50   ` Masami Hiramatsu
2023-10-31 22:33 ` [PATCH v5 3/7] eventfs: Test for ei->is_freed when accessing ei->dentry Steven Rostedt
2023-10-31 22:33 ` [PATCH v5 4/7] eventfs: Save ownership and mode Steven Rostedt
2023-11-01 23:43   ` Masami Hiramatsu
2023-11-01 23:47     ` Steven Rostedt
2023-10-31 22:33 ` [PATCH v5 5/7] eventfs: Hold eventfs_mutex when calling callback functions Steven Rostedt
2023-10-31 22:33 ` [PATCH v5 6/7] eventfs: Delete eventfs_inode when the last dentry is freed Steven Rostedt
2023-10-31 22:33 ` [PATCH v5 7/7] eventfs: Remove special processing of dput() of events directory Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).