On Thu, 13 Feb 2025 13:19:57 -0500
Steven Rostedt <[email protected]> wrote:

> From: Steven Rostedt <[email protected]>
> 
> Memory mapping the tracing ring buffer will disable resizing the buffer.
> But if there's an error in the memory mapping like an invalid parameter,
> the function exits out without re-enabling the resizing of the ring
> buffer, preventing the ring buffer from being resized after that.
> 

Looks good to me.

Reveiewed-by: Masami Hiramatsu (Google) <[email protected]>

Thank you,

> Cc: [email protected]
> Fixes: 117c39200d9d7 ("ring-buffer: Introducing ring-buffer mapping 
> functions")
> Signed-off-by: Steven Rostedt (Google) <[email protected]>
> ---
>  kernel/trace/ring_buffer.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index b8e0ae15ca5b..07b421115692 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -7126,6 +7126,7 @@ int ring_buffer_map(struct trace_buffer *buffer, int 
> cpu,
>               kfree(cpu_buffer->subbuf_ids);
>               cpu_buffer->subbuf_ids = NULL;
>               rb_free_meta_page(cpu_buffer);
> +             atomic_dec(&cpu_buffer->resize_disabled);
>       }
>  
>  unlock:
> -- 
> 2.47.2
> 


-- 
Masami Hiramatsu (Google) <[email protected]>

Reply via email to