Skip to content

Commit

Permalink
tracing: Remove extra zeroing out of the ring buffer page
Browse files Browse the repository at this point in the history
The ring_buffer_read_page() takes care of zeroing out any extra data in the
page that it returns. There's no need to zero it out again from the
consumer. It was removed from one consumer of this function, but
read_buffers_splice_read() did not remove it, and worse, it contained a
nasty bug because of it.

Cc: [email protected]
Fixes: 2711ca2 ("ring-buffer: Move zeroing out excess in page to ring buffer code")
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
  • Loading branch information
rostedt committed Dec 27, 2017
1 parent 45d8b80 commit 6b7e633
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -6769,7 +6769,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
.spd_release = buffer_spd_release,
};
struct buffer_ref *ref;
int entries, size, i;
int entries, i;
ssize_t ret = 0;

#ifdef CONFIG_TRACER_MAX_TRACE
Expand Down Expand Up @@ -6823,14 +6823,6 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
break;
}

/*
* zero out any left over data, this is going to
* user land.
*/
size = ring_buffer_page_len(ref->page);
if (size < PAGE_SIZE)
memset(ref->page + size, 0, PAGE_SIZE - size);

page = virt_to_page(ref->page);

spd.pages[i] = page;
Expand Down

0 comments on commit 6b7e633

Please sign in to comment.