[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YC6SjvU0iCSeHVVI@alley>
Date: Thu, 18 Feb 2021 17:15:10 +0100
From: Petr Mladek <pmladek@...e.com>
To: John Ogness <john.ogness@...utronix.de>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org
Subject: Re: [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@...utronix.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@...e.com>
Best Regards,
Petr
Powered by blists - more mailing lists