Re: [PATCH] printk: Fix unnecessary returning broken pipe error from devkmsg_read

From: John Ogness
Date: Mon Sep 23 2019 - 15:59:00 EST


On 2019-09-23, He Zhe <zhe.he@xxxxxxxxxxxxx> wrote:
>>>>> When users read the buffer from start, there is no need to return -EPIPE
>>>>> since the possible overflows will not affect the output.
>>>>>
>>>> [..]
>>>>> - if (user->seq < log_first_seq) {
>>>>> + if (user->seq == 0) {
>>>>> + user->seq = log_first_seq;
>>>>> + } else if (user->seq < log_first_seq) {
>>>>> /* our last seen message is gone, return error and reset */
>>>>> user->idx = log_first_idx;
>>>>> user->seq = log_first_seq;
>>
>> IMHO, the patch is wrong.
>
> If this is the case, I'm going to submit a patch for RT kernel.

It should be enough just to remove the if-branch.

FYI, this bug only exists in the RFCv1 of my proposed printk patchset,
which is what RT 5.x is based on. The code currently being prepared for
mainline does not have this issue.

Thanks for reporting. Looking forward to your patch.

John Ogness