]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - kernel/trace/ring_buffer.c
ring-buffer: Reset "real_end" when page is filled
[net-next-2.6.git] / kernel / trace / ring_buffer.c
index 7f6059c5aa94c772ba6ad9785c40838f96bbc77f..b0702ff782187a51eb57f146608c4e5a14cfe46e 100644 (file)
@@ -1768,6 +1768,14 @@ rb_reset_tail(struct ring_buffer_per_cpu *cpu_buffer,
         * must fill the old tail_page with padding.
         */
        if (tail >= BUF_PAGE_SIZE) {
+               /*
+                * If the page was filled, then we still need
+                * to update the real_end. Reset it to zero
+                * and the reader will ignore it.
+                */
+               if (tail == BUF_PAGE_SIZE)
+                       tail_page->real_end = 0;
+
                local_sub(length, &tail_page->write);
                return;
        }