teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0357-journald-Fix-off-by-one-error-in-Missed-X-kernel-mes.patch

84b277
From db22c5d0a16eb30b78cdeef927df8c2d0b895ef1 Mon Sep 17 00:00:00 2001
84b277
From: Eelco Dolstra <eelco.dolstra@logicblox.com>
84b277
Date: Wed, 6 Aug 2014 13:14:51 +0200
84b277
Subject: [PATCH] journald: Fix off-by-one error in "Missed X kernel messages"
84b277
 warning
84b277
84b277
On receiving a message, "kernel_seqnum" is set to "serial + 1". So
84b277
subtracting 1 will cause messages like "Missed 0 kernel messages",
84b277
which should be "Missed 1 kernel messages".
84b277
84b277
(cherry-picked from b9c488f60050248b35640f28e4d00958702ba1c3)
84b277
84b277
Resolves: #1147524
84b277
---
84b277
 src/journal/journald-kmsg.c | 2 +-
84b277
 1 file changed, 1 insertion(+), 1 deletion(-)
84b277
84b277
diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c
84b277
index e393cb7..0073a33 100644
84b277
--- a/src/journal/journald-kmsg.c
84b277
+++ b/src/journal/journald-kmsg.c
84b277
@@ -152,7 +152,7 @@ static void dev_kmsg_record(Server *s, char *p, size_t l) {
84b277
                 /* Did we lose any? */
84b277
                 if (serial > *s->kernel_seqnum)
84b277
                         server_driver_message(s, SD_MESSAGE_JOURNAL_MISSED, "Missed %"PRIu64" kernel messages",
84b277
-                                              serial - *s->kernel_seqnum - 1);
84b277
+                                              serial - *s->kernel_seqnum);
84b277
 
84b277
                 /* Make sure we never read this one again. Note that
84b277
                  * we always store the next message serial we expect