]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ring-buffer: Allow sparse CPU masks in ring_buffer_desc()
authorVincent Donnefort <vdonnefort@google.com>
Thu, 9 Jul 2026 16:00:17 +0000 (17:00 +0100)
committerSteven Rostedt <rostedt@goodmis.org>
Fri, 10 Jul 2026 18:04:26 +0000 (14:04 -0400)
No user currently relies on sparse CPU masks, but the descriptor logic already
supports them via linear fallback. Remove the arbitrary limitation.

Link: https://patch.msgid.link/20260709160017.1729517-4-vdonnefort@google.com
Fixes: 2e67fabd8b77 ("ring-buffer: Introduce ring-buffer remotes")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ring_buffer.c

index 12a83d9ffd0a94d0150084a1c5b0ee402fbded05..804ccae694d2151810da6ed0d2c01e069de1e529 100644 (file)
@@ -2330,10 +2330,7 @@ static struct ring_buffer_desc *ring_buffer_desc(struct trace_buffer_desc *trace
        size_t len;
        int i;
 
-       if (!trace_desc)
-               return NULL;
-
-       if (cpu >= trace_desc->nr_cpus)
+       if (!trace_desc || !trace_desc->nr_cpus)
                return NULL;
 
        end = (struct ring_buffer_desc *)((void *)trace_desc + trace_desc->struct_len);