From: Steven Rostedt <rostedt@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Andrew Morton <akpm@linux-foundation.org>,
stable@vger.kernel.org, Jackie Liu <liuyun01@kylinos.cn>,
Vincent Donnefort <vdonnefort@google.com>
Subject: [for-linus][PATCH 2/9] tracing: Propagate errors from remote event bulk updates
Date: Fri, 24 Jul 2026 19:18:42 -0400 [thread overview]
Message-ID: <20260724231855.758081600@kernel.org> (raw)
In-Reply-To: 20260724231840.483353969@kernel.org
From: Jackie Liu <liuyun01@kylinos.cn>
remote_events_dir_enable_write() ignores the return value from
trace_remote_enable_event(). If a remote rejects an event state change,
the write therefore reports success even though the affected event remains
in its previous state.
Keep trying all events, but retain and return the first error. This matches
__ftrace_set_clr_event_nolock(), which permits partial updates while
notifying userspace when an operation fails.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260715074455.3897-1-liu.yun@linux.dev
Fixes: 775cb093bc50 ("tracing: Add events/ root files to trace remotes")
Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
Reviewed-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/trace_remote.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/trace_remote.c b/kernel/trace/trace_remote.c
index ef42d9c38b37..e6724f947170 100644
--- a/kernel/trace/trace_remote.c
+++ b/kernel/trace/trace_remote.c
@@ -1149,10 +1149,21 @@ static ssize_t remote_events_dir_enable_write(struct file *filp, const char __us
for (i = 0; i < remote->nr_events; i++) {
struct remote_event *evt = &remote->events[i];
+ int eret;
- trace_remote_enable_event(remote, evt, enable);
+ eret = trace_remote_enable_event(remote, evt, enable);
+ /*
+ * Save the first error and return that. Some events
+ * may still have been enabled, but let the user
+ * know that something went wrong.
+ */
+ if (!ret && eret)
+ ret = eret;
}
+ if (ret)
+ return ret;
+
return count;
}
--
2.53.0
next prev parent reply other threads:[~2026-07-24 23:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 23:18 [for-linus][PATCH 0/9] tracing: Fixes for 7.2 Steven Rostedt
2026-07-24 23:18 ` [for-linus][PATCH 1/9] tracing/remotes: Fix page_va[] access before counter update in trace_remote_alloc_buffer() Steven Rostedt
2026-07-24 23:18 ` Steven Rostedt [this message]
2026-07-24 23:18 ` [for-linus][PATCH 3/9] tracing: Fix resource leak on mmiotrace trace_pipe close Steven Rostedt
2026-07-24 23:18 ` [for-linus][PATCH 4/9] tracing: Fix mmiotrace possible NULL dereferencing of hiter->dev Steven Rostedt
2026-07-24 23:18 ` [for-linus][PATCH 5/9] tracing: Fix union collision of module and refcnt for dynamic events Steven Rostedt
2026-07-24 23:18 ` [for-linus][PATCH 6/9] selftests/ftrace: Reset triggers at top level before instance loop Steven Rostedt
2026-07-24 23:18 ` [for-linus][PATCH 7/9] tracing: Fix context switch counter truncation Steven Rostedt
2026-07-24 23:18 ` [for-linus][PATCH 8/9] tracing: Fix use-after-free freeing trigger private data Steven Rostedt
2026-07-24 23:18 ` [for-linus][PATCH 9/9] tracing: Delay module ref count for "enable_event" trigger Steven Rostedt
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=20260724231855.758081600@kernel.org \
--to=rostedt@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyun01@kylinos.cn \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=stable@vger.kernel.org \
--cc=vdonnefort@google.com \
/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