Re: [PATCH v3] tracing: Have format file honor EVENT_FILE_FL_FREED

From: Steven Rostedt
Date: Tue Jul 30 2024 - 11:14:46 EST


On Tue, 30 Jul 2024 11:06:57 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> Link: https://lore.kernel.org/all/20240719204701.1605950-1-minipli@xxxxxxxxxxxxxx/
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: b63db58e2fa5d ("eventfs/tracing: Add callback for release of an eventfs_inode")
> Reported-by: Mathias Krause <minipli@xxxxxxxxxxxxxx>
> Tested-by: Mathias Krause <minipli@xxxxxxxxxxxxxx>

Hi Mathias,

I kept your "Tested-by" tag because you did test the part that fixes the
bug you reported. I just added on top of that one to handle other possibly
cases. Let me know if you want me to drop that tag, or if you tested this
version as well.

Thanks,

-- Steve


> Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
> ---
> Changes since v3: https://lore.kernel.org/20240726132811.306a449e@xxxxxxxxxxxxxxxxxxxx
>
> - After inspecting the code, there's several users of event_file_data()
> that return the trace_event_file descriptor when it could be set to be
> freed. Add a new helper function: event_file_file() that will make sure
> the event_mutex is held and check the flag and return NULL if the file is
> freed.