Re: [PATCH v5 2/4] tracing: Make the backup instance non-reusable

From: Steven Rostedt

Date: Thu Jan 29 2026 - 14:53:50 EST


On Wed, 28 Jan 2026 09:09:56 +0900
"Masami Hiramatsu (Google)" <mhiramat@xxxxxxxxxx> wrote:

> @@ -9388,12 +9405,16 @@ static void
> tracing_init_tracefs_percpu(struct trace_array *tr, long cpu)
> {
> struct dentry *d_percpu = tracing_dentry_percpu(tr, cpu);
> + umode_t writable_mode = TRACE_MODE_WRITE;
> struct dentry *d_cpu;
> char cpu_dir[30]; /* 30 characters should be more than enough */
>
> if (!d_percpu)
> return;
>
> + if (trace_array_is_readonly(tr))
> + writable_mode = TRACE_MODE_READ;

Hmm, writable_mode is set but not used?

Looks like you missed an update.

-- Steve

> +
> snprintf(cpu_dir, 30, "cpu%ld", cpu);
> d_cpu = tracefs_create_dir(cpu_dir, d_percpu);
> if (!d_cpu) {
> @@ -9616,7 +9637,6 @@ struct dentry *trace_create_file(const char *name,
> return ret;
> }