Patch 1 fixes a race condition in ring_buffer_swap_cpu() where the
committing counter check can be bypassed during a write operation,
leading to inconsistent buffer state and a RB_WARN_ON. The fix uses
current_context instead, which remains valid throughout the entire
write.

Patch 2 improves the snapshot user experience by using work_on_cpu()
instead of smp_call_function_single(), ensuring the swap only occurs
after any ongoing write completes and avoiding confusing -EBUSY errors.

Changelog:
v2: Add fix patch for ring_buffer_swap_cpu(). (Steven)
    Reorganize commit messages and Fixes tags.
v1: 
https://lore.kernel.org/all/[email protected]/

Tengda Wu (2):
  ring-buffer: Use current_context for safe per-CPU buffer swap
  tracing/snapshot: Use work_on_cpu to avoid -EBUSY during snapshot swap

 kernel/trace/ring_buffer.c    | 8 ++++----
 kernel/trace/trace_snapshot.c | 8 +++++---
 2 files changed, 9 insertions(+), 7 deletions(-)

-- 
2.34.1


Reply via email to