Re: [PATCH] printk: ringbuffer: fix line counting

2021-01-15 Thread Petr Mladek
On Wed 2021-01-13 15:48:34, John Ogness wrote: > Counting text lines in a record simply involves counting the number > of newline characters (+1). However, it is searching the full data > block for newline characters, even though the text data can be (and > often is) a subset of that area. Since

Re: [PATCH] printk: ringbuffer: fix line counting

2021-01-14 Thread Sergey Senozhatsky
On (21/01/13 15:48), John Ogness wrote: > > Counting text lines in a record simply involves counting the number > of newline characters (+1). However, it is searching the full data > block for newline characters, even though the text data can be (and > often is) a subset of that area. Since the

Re: [PATCH] printk: ringbuffer: fix line counting

2021-01-14 Thread John Ogness
On 2021-01-14, Petr Mladek wrote: >> --- a/kernel/printk/printk_ringbuffer.c >> +++ b/kernel/printk/printk_ringbuffer.c >> @@ -1718,7 +1718,7 @@ static bool copy_data(struct prb_data_ring *data_ring, >> >> /* Caller interested in the line count? */ >> if (line_count) >> -

Re: [PATCH] printk: ringbuffer: fix line counting

2021-01-14 Thread Petr Mladek
On Wed 2021-01-13 15:48:34, John Ogness wrote: > Counting text lines in a record simply involves counting the number > of newline characters (+1). However, it is searching the full data > block for newline characters, even though the text data can be (and > often is) a subset of that area. Since

[PATCH] printk: ringbuffer: fix line counting

2021-01-13 Thread John Ogness
Counting text lines in a record simply involves counting the number of newline characters (+1). However, it is searching the full data block for newline characters, even though the text data can be (and often is) a subset of that area. Since the extra area in the data block was never initialized,