]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: don't insist that the journal file header's boot ID matches the last entry 8513/head
authorLennart Poettering <lennart@poettering.net>
Tue, 20 Mar 2018 19:41:30 +0000 (20:41 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 20 Mar 2018 22:31:11 +0000 (23:31 +0100)
We update the boot ID whenever the file is opened for writing (i.e. set
to ONLINE stat), even if we never write a single entry to it. Hence,
don't insist that the last entry's boot ID matches the file header.

As pointed out by Matthijs van Duin:

https://lists.freedesktop.org/archives/systemd-devel/2018-March/040499.html

src/journal/journal-verify.c

index dc6b21b1e9bac4b6f01fe35d1a5f780223e1f5d2..4d35168591e10d56dffab5acdd1173d82e5af5b0 100644 (file)
@@ -1245,7 +1245,7 @@ int journal_file_verify(
         }
 
         if (entry_monotonic_set &&
-            (!sd_id128_equal(entry_boot_id, f->header->boot_id) ||
+            (sd_id128_equal(entry_boot_id, f->header->boot_id) &&
              entry_monotonic != le64toh(f->header->tail_entry_monotonic))) {
                 error(0, "Invalid tail monotonic timestamp");
                 r = -EBADMSG;