lkml.org 
[lkml]   [2021]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/2] tracing: Simplify the max length test when using the filtering temp buffer
On Wed, Jun 9, 2021 at 3:05 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> val = this_cpu_inc_return(trace_buffered_event_cnt);
> - if ((len < (PAGE_SIZE - sizeof(*entry) - sizeof(entry->array[0]))) && val == 1) {
> + if (val == 1 && unlikely(len < max_len)) {

unlikely? No.

Also, I still think that "len < max_len" should actually be "len <=
max_len". It should be ok to use the whole page, no?

Unless there is some *other* overflow issue, and "len" doesn't contain
a terminating NUL character or something like that.

Linus

\
 
 \ /
  Last update: 2021-06-10 00:22    [W:0.046 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site