tracing: fix ref count in splice pages
authorSteven Rostedt <srostedt@redhat.com>
Wed, 29 Apr 2009 04:16:21 +0000 (00:16 -0400)
committerIngo Molnar <mingo@elte.hu>
Wed, 29 Apr 2009 06:02:44 +0000 (08:02 +0200)
The pages allocated for the splice binary buffer did not initialize
the ref count correctly. This caused pages not to be freed and causes
a drastic memory leak.

Thanks to logdev I was able to trace the tracer to find where the leak
was.

[ Impact: stop memory leak when using splice ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/trace/trace.c

index 1ce5dc6..a884c09 100644 (file)
@@ -3448,6 +3448,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
                if (!ref)
                        break;
 
+               ref->ref = 1;
                ref->buffer = info->tr->buffer;
                ref->page = ring_buffer_alloc_read_page(ref->buffer);
                if (!ref->page) {