# Re: \[PATCH v8 1/3\] tracing: Fix subbuf resize races with trace\_pipe\_raw readers

- From: Vincent Donnefort \<vdonnefort@google.com\>
- Date: 2026-08-27 06:31:29 
- List: linux-trace-kernel
- Page: https://ratatoskr.run/linux-trace-kernel/2026/08/17468047
- Thread: https://ratatoskr.run/sashiko-reviews/2026/08/17465043/t.md

```text
On Wed, Aug 26, 2026 at 02:31:23PM -0400, Steven Rostedt wrote:
> On Wed, 26 Aug 2026 17:24:35 +0100
> Vincent Donnefort [ref] wrote:
> 
> > > This is a legitimate concern. But with an easy solution. Perhaps just add:
> > > 
> > > 	if (full &&
> > > 	    (!read || (len < (size - read)) ||
> > > -	     cpu_buffer->reader_page == cpu_buffer->commit_page))
> > > +	     cpu_buffer->reader_page == cpu_buffer->commit_page) &&
> > > +	    data_page->order == buffer->subbuf_order)
> > > 		return -1;
> > > 
> > > If the user is changing the buffer size at the same time as reading raw
> > > pages, they get what they deserve! I just don't want to let the kernel go
> > > into an infinite loop.
> > > 
> > > -- Steve
> > >   
> > 
> > Sounds good. Do you prefer to get a v9 or you fold this into the existing commit?
> > 
> 
> Please send a v9. It makes the patchwork flow much better. If I modify a
> patch, it makes patchwork not be able to automate the status updates as it
> moves around git trees.
> 
> Thanks,
> 
> -- Steve
> 

Looking at the function again, shouldn't we add !rb_is_static(cpu_buffer) as
well to the full page test?

-- 
Vincent
```
