FAILED: patch "[PATCH] tracing: Fix logged instance name on creation failure" failed to apply to 6.6-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x a9a01be2834a529cbd490ccbab02643f0c1735f2
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026090305-creole-floral-cc49@gregkh' --subject-prefix 'PATCH 6.6.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From a9a01be2834a529cbd490ccbab02643f0c1735f2 Mon Sep 17 00:00:00 2001
From: Vincent Donnefort <[email protected]>
Date: Fri, 7 Aug 2026 09:54:23 +0100
Subject: [PATCH] tracing: Fix logged instance name on creation failure
When boot instance creation fails, the kernel incorrectly logs "(null)" as the instance name because strsep() consumes curr_str entirely during parsing.
Print the properly parsed name variable instead. And while at it log the error code.
kernel/trace/trace.c +2 -1
@@ -9726,7 +9726,8 @@ __init static void enable_instances(void) tr =trace_array_create_systems (name,NULL , addr, size);if (IS_ERR (tr)) { -pr_warn ("Tracing: Failed to create instance buffer %s\n" , curr_str); +pr_warn ("Tracing: Failed to create instance buffer '%s' (%ld)\n" , name, +PTR_ERR (tr));continue ; }
Sasha Levin
maintainerPATCH 1/2 tracing: Fix NULL vs IS_ERR() check in enable_instances()
From: Dan Carpenter <[email protected]>
[ Upstream commit 94dfa500e7deddceff22768bb994f0fa67bd2fd0 ]
The trace_array_create_systems() function returns error pointers, not NULL. Fix the check to match.
Stable-dep-of: a9a01be2834a ("tracing: Fix logged instance name on creation failure")
--- kernel/trace/trace.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
kernel/trace/trace.c +18 -7
@@ -9416,11 +9416,17 @@ static int trace_array_create_dir(struct trace_array *tr) }static struct trace_array * -trace_array_create_systems (const char *name,const char *systems) +trace_array_create_systems (const char *name,const char *systems, +unsigned long range_addr_start, +unsigned long range_addr_size) {struct trace_array *tr;int ret; +/* Reserved-memory trace buffers are not supported by this kernel. */ + (void )range_addr_start; + (void )range_addr_size; + ret = -ENOMEM ; tr =kzalloc (sizeof (*tr),GFP_KERNEL );if (!tr)
@@ -9494,7 +9500,7 @@ trace_array_create_systems(const char *name, const char *systems)static struct trace_array *trace_array_create (const char *name) { -return trace_array_create_systems (name,NULL ); +return trace_array_create_systems (name,NULL ,0 ,0 ); }static int instance_mkdir (const char *name)
@@ -9548,7 +9554,7 @@ struct trace_array *trace_array_get_by_name(const char *name, const char *system goto out_unlock; } - tr =trace_array_create_systems (name, systems); + tr =trace_array_create_systems (name, systems,0 ,0 );if (IS_ERR (tr)) tr =NULL ;
@@ -10300,6 +10306,7 @@ __init static void enable_instances(void) {struct trace_array *tr;char *curr_str; +char *name;char *str;char *tok;
@@ -10308,17 +10315,21 @@ __init static void enable_instances(void) str = boot_instance_info;while ((curr_str =strsep (&str,"\t" ))) { +unsigned long addr =0 ; +unsigned long size =0 ; tok =strsep (&curr_str,"," ); + name = tok;if (IS_ENABLED (CONFIG_TRACER_MAX_TRACE )) -do_allocate_snapshot (tok); +do_allocate_snapshot (name); - tr =trace_array_get_by_name (tok,NULL ); -if (!tr) { -pr_warn ("Failed to create instance buffer %s\n" , curr_str); + tr =trace_array_create_systems (name,NULL , addr, size); +if (IS_ERR (tr)) { +pr_warn ("Tracing: Failed to create instance buffer %s\n" , curr_str);continue ; } +/* Allow user space to delete it */ trace_array_put (tr);
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 2/2 tracing: Fix logged instance name on creation failure
From: Vincent Donnefort <[email protected]>
[ Upstream commit a9a01be2834a529cbd490ccbab02643f0c1735f2 ]
When boot instance creation fails, the kernel incorrectly logs "(null)" as the instance name because strsep() consumes curr_str entirely during parsing.
Print the properly parsed name variable instead. And while at it log the error code.
--- kernel/trace/trace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/trace/trace.c +2 -1
@@ -10326,7 +10326,8 @@ __init static void enable_instances(void) tr =trace_array_create_systems (name,NULL , addr, size);if (IS_ERR (tr)) { -pr_warn ("Tracing: Failed to create instance buffer %s\n" , curr_str); +pr_warn ("Tracing: Failed to create instance buffer '%s' (%ld)\n" , name, +PTR_ERR (tr));continue ; }
Signature · 1 line
2.53.0