]> git.baikalelectronics.ru Git - kernel.git/commit
ring-buffer: Add rb_list_head() wrapper around new reader page next field
authorSteven Rostedt <srostedt@redhat.com>
Thu, 7 Jan 2010 01:40:44 +0000 (20:40 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Thu, 7 Jan 2010 01:40:44 +0000 (20:40 -0500)
commit2877c7f37be5f83fb693abac5c45458d0d6f583a
treee9a9600a14fa4d1f2b045097c9e9d7d03463f0bf
parent5a0125ed7c516304c9d953dddd7eb8ade1ed208d
ring-buffer: Add rb_list_head() wrapper around new reader page next field

If the very unlikely case happens where the writer moves the head by one
between where the head page is read and where the new reader page
is assigned _and_ the writer then writes and wraps the entire ring buffer
so that the head page is back to what was originally read as the head page,
the page to be swapped will have a corrupted next pointer.

Simple solution is to wrap the assignment of the next pointer with a
rb_list_head().

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ring_buffer.c