On Tue, 28 Apr 2026 16:21:46 -0400
Steven Rostedt <[email protected]> wrote:

> On Fri, 24 Apr 2026 15:52:35 +0900
> "Masami Hiramatsu (Google)" <[email protected]> wrote:
> 
> > @@ -1892,9 +1895,19 @@ static int rb_validate_buffer(struct 
> > buffer_data_page *dpage, int cpu,
> >      * subbuf_size is considered invalid.
> >      */
> >     tail = local_read(&dpage->commit) & ~RB_MISSED_MASK;
> > -   if (tail > meta->subbuf_size - BUF_PAGE_HDR_SIZE)
> > -           return -1;
> > -   return rb_read_data_buffer(dpage, tail, cpu, &ts, &delta);
> > +   if (tail <= meta->subbuf_size - BUF_PAGE_HDR_SIZE)
> > +           ret = rb_read_data_buffer(dpage, tail, cpu, &ts, &delta);
> > +
> 
> This code seriously needs comments.

OK, I'll add it, or let code explain clearer?

        if (tail <= meta->subbuf_size - BUF_PAGE_HDR_SIZE)
                ret = rb_read_data_buffer(dpage, tail, cpu, &ts, &delta);
        else
                ret = -1;

Thanks,

> 
> -- Steve
> 
> > +   if (ret < 0 || (prev_ts && prev_ts > ts) || (next_ts && ts > next_ts)) {
> > +           local_set(&bpage->entries, 0);
> > +           local_set(&bpage->page->commit, 0);
> > +           bpage->page->time_stamp = prev_ts ? prev_ts : next_ts;
> > +           ret = -1;
> > +   } else {
> > +           local_set(&bpage->entries, ret);
> > +   }
> > +
> > +   return ret;
> >  }
> >  


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

Reply via email to