lkml.org 
[lkml]   [2021]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH printk-rework 01/14] printk: limit second loop of syslog_print_all
On Thu 2021-02-18 09:18:04, John Ogness wrote:
> The second loop of syslog_print_all() subtracts lengths that were
> added in the first loop. With commit b031a684bfd0 ("printk: remove
> logbuf_lock writer-protection of ringbuffer") it is possible that
> records are (over)written during syslog_print_all(). This allows the
> possibility of the second loop subtracting lengths that were never
> added in the first loop.
>
> This situation can result in syslog_print_all() filling the buffer
> starting from a later record, even though there may have been room
> to fit the earlier record(s) as well.
>
> Fixes: b031a684bfd0 ("printk: remove logbuf_lock writer-protection of ringbuffer")
> Signed-off-by: John Ogness <john.ogness@linutronix.de>

It makes sense after all. We reach the limit only when many old
messages has got replaced. It means that there is a flood
of messages. And this limit looks like a reasonable point where
to start filling the provided buffer.

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr

\
 
 \ /
  Last update: 2021-02-18 19:40    [W:0.331 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site