public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] printk: Fix unnecessary returning broken pipe error from devkmsg_read
@ 2019-09-18 13:31 zhe.he
  2019-09-23 10:05 ` Sergey Senozhatsky
  0 siblings, 1 reply; 7+ messages in thread
From: zhe.he @ 2019-09-18 13:31 UTC (permalink / raw)
  To: pmladek, sergey.senozhatsky, rostedt, linux-kernel, zhe.he

From: He Zhe <zhe.he@windriver.com>

When users read the buffer from start, there is no need to return -EPIPE
since the possible overflows will not affect the output.

Signed-off-by: He Zhe <zhe.he@windriver.com>
---
 kernel/printk/printk.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 1888f6a..4a6a129 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -886,7 +886,9 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf,
 		logbuf_lock_irq();
 	}
 
-	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;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-09-24  1:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-18 13:31 [PATCH] printk: Fix unnecessary returning broken pipe error from devkmsg_read zhe.he
2019-09-23 10:05 ` Sergey Senozhatsky
2019-09-23 10:45   ` He Zhe
2019-09-23 11:39     ` Petr Mladek
2019-09-23 14:11       ` He Zhe
2019-09-23 19:58         ` John Ogness
2019-09-24  1:10     ` Sergey Senozhatsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox