tracing: Fix comment in tracing_buffers_splice_read()

The comment about returning an error if the read fails on the first
iteration is slightly incorrect. It makes it sound like the only reason it
could fail on a later iteration is if the subbuf order changed. That is
incorrect, it could also fail if the length passed in was not a multiple
of the subbuf size. Fix the comment.

Link: https://lore.kernel.org/all/20260904143527.40e73d36@gandalf.local.home/
Link: https://patch.msgid.link/20260904144902.506862a1@gandalf.local.home
Fixes: dae8dda341 ("tracing: Fix subbuf resize races with trace_pipe_raw readers")
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
Steven Rostedt 2026-09-04 14:49:02 -04:00
parent c843fd3c73
commit 5cbea50077

View File

@ -7296,11 +7296,13 @@ ssize_t tracing_buffers_splice_read(struct file *file, loff_t *ppos,
r = ring_buffer_read_page(ref->buffer, ref->rpage, len, iter->cpu_file, 1);
} else if (!i) {
/*
* We failed to read because the length is too small
* or unaligned. If this is the first iteration, it's
* an invalid userspace input. Otherwise, this is due
* to a subbuf order change. Do not report an error
* and just finish the read.
* If this fails to read on the first iteration, it
* means the length was too small and an error should
* be returned to user space. Otherwise, at least
* one sub-buffer was successfully read but this failed
* due to either the length was unaligned or the
* subbuf order changed. Either case, do not report
* an error.
*/
ret = -EINVAL;
}