Re: [PATCH] printk: Fix seq check inside devkmsg_read()

From: John Ogness
Date: Tue Jan 18 2022 - 08:20:39 EST


On 2022-01-18, Mukesh Ojha <quic_mojha@xxxxxxxxxxx> wrote:
> prb_read_valid() could return a record whose seq number can be
> newer than the requested one. In that case, we allow the reading
> of the data instead of erroring out.

The EPIPE error is intentional. It informs the devkmsg reader that a
record was missed.

For simple readers, like cat(1), this means that the kernel messages
cannot be read completely reliably. We talked about this a while back
[0] because initially I wanted to do what your patch does. In the end it
was agreed that readers of /dev/kmsg must implement EPIPE handling for
missed records.

John Ogness

[0] https://lore.kernel.org/all/87pneiyv12.fsf@xxxxxxxxxxxxx