diff options
author | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2017-12-23 02:38:57 +0100 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2017-12-27 20:20:59 +0100 |
commit | 6b7e633fe9c24682df550e5311f47fb524701586 (patch) | |
tree | cb9c16b9dba5b122889f75ea7097088aaa82af20 /kernel/trace/trace.c | |
parent | ring-buffer: Mask out the info bits when returning buffer page length (diff) | |
download | linux-6b7e633fe9c24682df550e5311f47fb524701586.tar.xz linux-6b7e633fe9c24682df550e5311f47fb524701586.zip |
tracing: Remove extra zeroing out of the ring buffer page
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: stable@vger.kernel.org
Fixes: 2711ca237a084 ("ring-buffer: Move zeroing out excess in page to ring buffer code")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to '')
-rw-r--r-- | kernel/trace/trace.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 59518b8126d0..73652d5318b2 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -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 @@ -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; |