• L
    ring_buffer: reset write when reserve buffer fail · 551b4048
    Lai Jiangshan 提交于
    Impact: reset struct buffer_page.write when interrupt storm
    
    if struct buffer_page.write is not reset, any succedent committing
    will corrupted ring_buffer:
    
    static inline void
    rb_set_commit_to_write(struct ring_buffer_per_cpu *cpu_buffer)
    {
    	......
    		cpu_buffer->commit_page->commit =
    			cpu_buffer->commit_page->write;
    	......
    }
    
    when "if (RB_WARN_ON(cpu_buffer, next_page == reader_page))", ring_buffer
    is disabled, but some reserved buffers may haven't been committed.
    we need reset struct buffer_page.write.
    
    when "if (unlikely(next_page == cpu_buffer->commit_page))", ring_buffer
    is still available, we should not corrupt it.
    Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
    Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
    Signed-off-by: NIngo Molnar <mingo@elte.hu>
    551b4048
ring_buffer.c 62.0 KB