diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-12-10 23:20:52 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-12-10 23:20:52 -0500 |
commit | dd7f59435782a02ceb6d16b9ce823dd3345d75ec (patch) | |
tree | d85e0a7b2b587b41afd1c764e7c25b3fa2962613 /kernel/trace/ring_buffer.c | |
parent | 184210154b9aa570099183f6c062ac4eb11190b7 (diff) |
ring-buffer: Move resize integrity check under reader lock
While using an application that does splice on the ftrace ring
buffer at start up, I triggered an integrity check failure.
Looking into this, I discovered that resizing the buffer performs
an integrity check after the buffer is resized. This check unfortunately
is preformed after it releases the reader lock. If a reader is
reading the buffer it may cause the integrity check to trigger a
false failure.
This patch simply moves the integrity checker under the protection
of the ring buffer reader lock.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/ring_buffer.c')
-rw-r--r-- | kernel/trace/ring_buffer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 0d64c51ab4df..eccb4cf1e998 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
@@ -1208,9 +1208,9 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned nr_pages) | |||
1208 | return; | 1208 | return; |
1209 | 1209 | ||
1210 | rb_reset_cpu(cpu_buffer); | 1210 | rb_reset_cpu(cpu_buffer); |
1211 | spin_unlock_irq(&cpu_buffer->reader_lock); | ||
1212 | |||
1213 | rb_check_pages(cpu_buffer); | 1211 | rb_check_pages(cpu_buffer); |
1212 | |||
1213 | spin_unlock_irq(&cpu_buffer->reader_lock); | ||
1214 | } | 1214 | } |
1215 | 1215 | ||
1216 | static void | 1216 | static void |
@@ -1233,9 +1233,9 @@ rb_insert_pages(struct ring_buffer_per_cpu *cpu_buffer, | |||
1233 | list_add_tail(&bpage->list, cpu_buffer->pages); | 1233 | list_add_tail(&bpage->list, cpu_buffer->pages); |
1234 | } | 1234 | } |
1235 | rb_reset_cpu(cpu_buffer); | 1235 | rb_reset_cpu(cpu_buffer); |
1236 | spin_unlock_irq(&cpu_buffer->reader_lock); | ||
1237 | |||
1238 | rb_check_pages(cpu_buffer); | 1236 | rb_check_pages(cpu_buffer); |
1237 | |||
1238 | spin_unlock_irq(&cpu_buffer->reader_lock); | ||
1239 | } | 1239 | } |
1240 | 1240 | ||
1241 | /** | 1241 | /** |