Re: [PATCH] printk: Do not lose last line in kmsg dump

2019-07-10 Thread Steven Rostedt
On Wed, 10 Jul 2019 14:10:49 +0200 Petr Mladek wrote: > On Wed 2019-07-10 17:19:22, Sergey Senozhatsky wrote: > > > arch/powerpc/xmon/xmon.c > > > 2836: while (kmsg_dump_get_line_nolock(&dumper, false, buf, > > > sizeof(buf), &len)) { > > > 2837- buf[len] = '\0'; > > > > > > a

Re: [PATCH] printk: Do not lose last line in kmsg dump

2019-07-10 Thread Petr Mladek
On Wed 2019-07-10 17:19:22, Sergey Senozhatsky wrote: > On (07/10/19 10:04), Vincent Whitchurch wrote: > > > > [..] > > > > > > > > > @@ -1318,7 +1318,7 @@ static size_t msg_print_text(const struct > > > > > printk_log *msg, bool syslog, > > > > > } > > > > > > > > > >

Re: [PATCH] printk: Do not lose last line in kmsg dump

2019-07-10 Thread Sergey Senozhatsky
On (07/09/19 16:29), Petr Mladek wrote: > > Anyway, if nobody vetoes the patch, I would schedule it for 5.4. > We are already in the merge window and it deserves some testing > in linux-next. > I don't really want to veto it, but I'm not comfortable with fixing off-by-one error by introducing an

Re: [PATCH] printk: Do not lose last line in kmsg dump

2019-07-10 Thread Sergey Senozhatsky
On (07/10/19 10:04), Vincent Whitchurch wrote: > > > [..] > > > > > > > @@ -1318,7 +1318,7 @@ static size_t msg_print_text(const struct > > > > printk_log *msg, bool syslog, > > > > } > > > > > > > > if (buf) { > > > > - if (prefix_len + tex

Re: [PATCH] printk: Do not lose last line in kmsg dump

2019-07-10 Thread Vincent Whitchurch
On Tue, Jul 09, 2019 at 04:29:39PM +0200, Petr Mladek wrote: > On Tue 2019-07-09 19:12:30, Sergey Senozhatsky wrote: > > On (07/09/19 10:10), Vincent Whitchurch wrote: > > > A dump of a 64-byte buffer filled by kmsg_dump_get_buffer(), before this > > > patch: > > > > > > : 3c 30 3e 5b 20

Re: [PATCH] printk: Do not lose last line in kmsg dump

2019-07-09 Thread Steven Rostedt
On Tue, 9 Jul 2019 16:29:39 +0200 Petr Mladek wrote: > Anyway, if nobody vetoes the patch, I would schedule it for 5.4. > We are already in the merge window and it deserves some testing > in linux-next. +1 -- Steve

Re: [PATCH] printk: Do not lose last line in kmsg dump

2019-07-09 Thread Petr Mladek
On Tue 2019-07-09 19:12:30, Sergey Senozhatsky wrote: > On (07/09/19 10:10), Vincent Whitchurch wrote: > > A dump of a 64-byte buffer filled by kmsg_dump_get_buffer(), before this > > patch: > > > > : 3c 30 3e 5b 20 20 20 20 36 2e 35 32 32 31 39 37 <0>[6.522197 > > 0010: 5d 20 4

Re: [PATCH] printk: Do not lose last line in kmsg dump

2019-07-09 Thread Sergey Senozhatsky
On (07/09/19 10:10), Vincent Whitchurch wrote: > A dump of a 64-byte buffer filled by kmsg_dump_get_buffer(), before this > patch: > > : 3c 30 3e 5b 20 20 20 20 36 2e 35 32 32 31 39 37 <0>[6.522197 > 0010: 5d 20 41 41 41 41 41 41 41 41 41 41 41 41 41 0a ] A. >

[PATCH] printk: Do not lose last line in kmsg dump

2019-07-09 Thread Vincent Whitchurch
kmsg_dump_get_buffer() is supposed to select the youngest log messages which fit into the provided buffer. When that function determines the correct start index, by looping and calling msg_print_text() with a NULL buffer, msg_print_text() calculates a length which would allow the youngest log mess