From: Petr Pavlu <petr.pavlu@suse.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Tom Zanussi <zanussi@kernel.org>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] tracing: Fix checking of freed trace_event_file for id files
Date: Thu, 12 Feb 2026 09:15:21 +0100 [thread overview]
Message-ID: <71ebc4fb-6992-4a15-93e3-43390f2216d7@suse.com> (raw)
In-Reply-To: <20260211113752.54bf37e9@fedora>
On 2/11/26 5:37 PM, Steven Rostedt wrote:
> On Tue, 10 Feb 2026 12:28:17 +0100
> Petr Pavlu <petr.pavlu@suse.com> wrote:
>
>> The code for reading an event id currently uses file->f_inode->i_private to
>> store the value of trace_event_file->event_call->event.type, unlike all
>> other event files which use it to store a pointer to the associated
>> trace_event_file data. The event_id_read() function retrieves this id value
>> from i_private and checks if it is non-0/NULL to determine whether the
>> event is still valid. This approach worked in the past when
>> remove_event_file_dir() would set i_private to NULL for all files in an
>> event directory upon removal. However, with the introduction of eventfs,
>> i_private is assigned when an eventfs inode is allocated and remains set
>
>> throughout its lifetime. As a result, event_id_read() may fail to detect
>> that an event is being removed.
>
> Who cares? It's just an id. If the event is being removed, there's
> nothing wrong with still returning its id. The code currently is very
> simple, I don't want to make it complex for something nobody cares
> about.
I think one could argue that handling all event files in the same way is
less complex. It would also allow for a minor simplification where
event_callback() would no longer need to modify the data pointer and
eventfs then wouldn't need to pass it down to lookup_file() because it
could always use the default ei->data.
However, this is all minor and I can see your point of view. I'll drop
this patch.
--
Thanks,
Petr
next prev parent reply other threads:[~2026-02-12 8:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 11:28 [PATCH 0/5] Clean up access to trace_event_file from a file struct Petr Pavlu
2026-02-10 11:28 ` [PATCH 1/5] tracing: Fix checking of freed trace_event_file for hist files Petr Pavlu
2026-02-10 15:59 ` Masami Hiramatsu
2026-02-10 17:40 ` kernel test robot
2026-02-11 16:28 ` Steven Rostedt
2026-02-10 18:57 ` kernel test robot
2026-02-10 11:28 ` [PATCH 2/5] tracing: Fix checking of freed trace_event_file for id files Petr Pavlu
2026-02-11 16:37 ` Steven Rostedt
2026-02-12 8:15 ` Petr Pavlu [this message]
2026-02-10 11:28 ` [PATCH 3/5] tracing: Remove unnecessary check for EVENT_FILE_FL_FREED Petr Pavlu
2026-02-10 11:28 ` [PATCH 4/5] tracing: Clean up access to trace_event_file from a file pointer Petr Pavlu
2026-02-11 16:45 ` Steven Rostedt
2026-02-10 11:28 ` [PATCH 5/5] tracing: Free up file->private_data for use by individual events Petr Pavlu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=71ebc4fb-6992-4a15-93e3-43390f2216d7@suse.com \
--to=petr.pavlu@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
--cc=zanussi@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox