[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190923100513.GA51932@jagdpanzerIV>
Date: Mon, 23 Sep 2019 19:05:13 +0900
From: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To: zhe.he@...driver.com
Cc: pmladek@...e.com, sergey.senozhatsky@...il.com,
rostedt@...dmis.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] printk: Fix unnecessary returning broken pipe error from
devkmsg_read
On (09/18/19 21:31), zhe.he@...driver.com 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;
A tough call.
User-space wants to read messages which are gone: log_first_seq > user->seq.
I think returning EPIPE is sort of appropriate; user-space, possibly,
can printf(stderr, "Some /dev/kmsg messages are gone\n"); or something
like that.
-ss
Powered by blists - more mailing lists