• Steven Rostedt's avatar
    ring-buffer: Add rb_list_head() wrapper around new reader page next field · 0e1ff5d7
    Steven Rostedt authored
    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: default avatarSteven Rostedt <rostedt@goodmis.org>
    0e1ff5d7
ring_buffer.c 96 KB