Skip to contentSkip to conversation

FAILED: patch "[PATCH] tracing/osnoise: Fix missed cpus_read_unlock() in" failed to apply to 5.14-stable tree

PATCH [email protected] 2 participants 3 messages Sep 15, 2021 – Sep 16, 2021

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.14-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]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 4b6b08f2e45edda4c067ac40833e3c1f84383c0b Mon Sep 17 00:00:00 2001
From: "Qiang.Zhang" <[email protected]>
Date: Tue, 31 Aug 2021 10:29:19 +0800
Subject: [PATCH] tracing/osnoise: Fix missed cpus_read_unlock() in
start_per_cpu_kthreads()

When start_kthread() return error, the cpus_read_unlock() need to be called.

Fixes c8895e271f79 ("trace/osnoise: Support hotplug operations")
kernel/trace/trace_osnoise.c +3 -3
index 65b08b8e5bf8..ce053619f289 100644
@@ -1548,7 +1548,7 @@ static int start_kthread(unsigned int cpu)
 static int start_per_cpu_kthreads(struct trace_array *tr)
 {
 	struct cpumask *current_mask = &save_cpumask;
-	int retval;
+	int retval = 0;
 	int cpu;
 
 	cpus_read_lock();
@@ -1568,13 +1568,13 @@ static int start_per_cpu_kthreads(struct trace_array *tr)
 		retval = start_kthread(cpu);
 		if (retval) {
 			stop_per_cpu_kthreads();
-			return retval;
+			break;
 		}
 	}
 
 	cpus_read_unlock();
 
-	return 0;
+	return retval;
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
maintainer Acked-by Daniel Bristot de Oliveira
#1 lore raw

Review

Quoted 7 lines · On Wed, 15 Sep 2021 14:37:10 +0200 <[email protected]> wrote:
(quoted diff) +1 -1
 	cpus_read_unlock();
 
-	return 0;
+	return retval;
 }

The issue was that the latest kernel uses cpu_read_unlock() instead of put_online_cpus(), other than that, it was trivial to fix.

Below should apply cleanly to 5.14.

-- Steve

Quoted 1 line

From 4b6b08f2e45edda4c067ac40833e3c1f84383c0b Mon Sep 17 00:00:00 2001

From: "Qiang.Zhang" <[email protected]>
Date: Tue, 31 Aug 2021 10:29:19 +0800
Subject: [PATCH] tracing/osnoise: Fix missed cpus_read_unlock() in
start_per_cpu_kthreads()

When start_kthread() return error, the cpus_read_unlock() need to be called.

Fixes c8895e271f79 ("trace/osnoise: Support hotplug operations")
kernel/trace/trace_osnoise.c +3 -3
Index: linux-test.git/kernel/trace/trace_osnoise.c
===================================================================
@@ -1548,7 +1548,7 @@ static int start_kthread(unsigned int cp
 static int start_per_cpu_kthreads(struct trace_array *tr)
 {
 	struct cpumask *current_mask = &save_cpumask;
-	int retval;
+	int retval = 0;
 	int cpu;
 
 	get_online_cpus();
@@ -1568,13 +1568,13 @@ static int start_per_cpu_kthreads(struct
 		retval = start_kthread(cpu);
 		if (retval) {
 			stop_per_cpu_kthreads();
-			return retval;
+			break;
 		}
 	}
 
 	put_online_cpus();
 
-	return 0;
+	return retval;
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
author maintainer
#2 lore raw
Quoted 14 lines · Steven Rostedt

kernel/trace/trace_osnoise.c static int start_per_cpu_kthreads(struct · line 1578

Quoted 7 lines · On Wed, 15 Sep 2021 14:37:10 +0200 <[email protected]> wrote:
kernel/trace/trace_osnoise.c +1 -1
 	cpus_read_unlock();
 
-	return 0;
+	return retval;
 }

The issue was that the latest kernel uses cpu_read_unlock() instead of put_online_cpus(), other than that, it was trivial to fix.

Quoted 1 line

Below should apply cleanly to 5.14.

Now queued up, thanks.

greg k-h