Steven Rostedt 283740c619 tracing: Use same local variable when resetting the ring buffer
In the ftrace code that resets the ring buffer it references the
buffer with a local variable, but then uses the tr->buffer as the
parameter to reset. If the wakeup tracer is running, which can
switch the tr->buffer with the max saved buffer, this can break
the requirement of disabling the buffer before the reset.

   buffer = tr->buffer;
   ring_buffer_record_disable(buffer);
   synchronize_sched();
   __tracing_reset(tr->buffer, cpu);

If the tr->buffer is swapped, then the reset is not happening to the
buffer that was disabled. This will cause the ring buffer to fail.

Found with Li Zefan's ftrace_stress_test.

Cc: stable@kernel.org
Reported-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-03-12 20:29:20 -05:00
..
2009-09-21 14:29:21 +02:00
2009-12-15 08:53:10 -08:00
2009-12-22 12:27:34 -05:00
2010-02-25 12:02:13 +01:00
2009-12-06 21:10:56 +01:00
2010-02-03 10:21:57 +11:00
2009-09-18 09:48:52 -07:00
2009-12-14 23:55:34 +01:00
2010-01-21 13:40:18 +01:00
2009-07-24 10:53:29 +02:00
2009-12-31 19:45:04 +00:00
2010-02-26 08:20:46 +01:00
2010-02-02 06:58:27 +01:00
2009-12-09 10:03:07 +01:00
2010-02-18 14:30:18 -08:00
2009-12-22 14:10:37 -08:00
2009-09-23 18:13:10 -07:00
2010-01-21 13:40:18 +01:00