Re: [PATCH v1 4/9] tracing: Cache ring_buffer_max_event_size() for trace_marker

From
sashiko-bot@kernel.org
Date
2026-11-12 14:25:55
Reply to
Vincent Donnefort, 2026-11-12
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] tracing: inaccurate Fixes trailer in write_marker_to_buffer()
  commit
--

commit fc0aa729f88ae3461e4964c8c56c6c6eee40f687
Author: Vincent Donnefort [off-list ref]
tracing: Cache ring_buffer_max_event_size() for trace_marker

write_marker_to_buffer() calls ring_buffer_max_event_size() twice
without synchronisation against ring_buffer_subbuf_order_set(). If
subbuf_order grows between the two calls, cnt may expand past
TRACE_MARKER_MAX_SIZE. Read the maximum event size once so cnt can only
shrink, and drop the now-unreachable WARN_ON_ONCE().

Fixes: 2808e31ec12e ("ring-buffer: Add interface for configuring trace sub buffer size")
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
[Severity: Low]
In 2808e31ec12e ("ring-buffer: Add interface for configuring trace sub
buffer size"), ring_buffer_max_event_size() still read
buffer->max_data_size, which was initialized once at buffer allocation
and not updated by ring_buffer_subbuf_order_set().  It only started
computing the size dynamically from buffer->subbuf_order in 472ac478b14d
("ring-buffer: Dynamically calculate max_data_size").  Should the Fixes:
tag be:

  Fixes: 472ac478b14d ("ring-buffer: Dynamically calculate max_data_size")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261112141440.3050124-1-vdonnefort@google.com?part=4
Thread (13 messages) 13 messages, 2 authors, last reply 4d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help