Skip to content
/ linux Public

Commit b692577

Browse files
mhiramatgregkh
authored andcommitted
ring-buffer: Fix to update per-subbuf entries of persistent ring buffer
commit f35dbac upstream. Since the validation loop in rb_meta_validate_events() updates the same cpu_buffer->head_page->entries, the other subbuf entries are not updated. Fix to use head_page to update the entries field, since it is the cursor in this loop. Cc: stable@vger.kernel.org Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Ian Rogers <irogers@google.com> Fixes: 5f3b6e8 ("ring-buffer: Validate boot range memory events") Link: https://patch.msgid.link/177391153882.193994.17158784065013676533.stgit@mhiramat.tok.corp.google.com Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 886fa86 commit b692577

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/ring_buffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2017,7 +2017,7 @@ static void rb_meta_validate_events(struct ring_buffer_per_cpu *cpu_buffer)
20172017

20182018
entries += ret;
20192019
entry_bytes += local_read(&head_page->page->commit);
2020-
local_set(&cpu_buffer->head_page->entries, ret);
2020+
local_set(&head_page->entries, ret);
20212021

20222022
if (head_page == cpu_buffer->commit_page)
20232023
break;

0 commit comments

Comments
 (0)