ring-buffer: Do no swap cpu buffers if order is different
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 19 Dec 2023 18:54:21 +0000 (13:54 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 21 Dec 2023 15:54:50 +0000 (10:54 -0500)
commitb81e03a24966dca0b119eff0549a4e44befff419
treefb95fb6dca1a4b2447a8f976e4287ecc5ebba990
parent22887dfba0633c09444562722f0cf68f61ec9a50
ring-buffer: Do no swap cpu buffers if order is different

As all the subbuffer order (subbuffer sizes) must be the same throughout
the ring buffer, check the order of the buffers that are doing a CPU
buffer swap in ring_buffer_swap_cpu() to make sure they are the same.

If the are not the same, then fail to do the swap, otherwise the ring
buffer will think the CPU buffer has a specific subbuffer size when it
does not.

Link: https://lore.kernel.org/linux-trace-kernel/20231219185629.467894710@goodmis.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Cc: Vincent Donnefort <vdonnefort@google.com>
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ring_buffer.c