]> git.ipfire.org Git - thirdparty/systemd.git/commit
journal: Invert verify entry <=> data consistency checks
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 25 Jan 2022 13:26:22 +0000 (13:26 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 26 Jan 2022 20:16:00 +0000 (20:16 +0000)
commit578cd1855b73d2710ae14a8d77c4fac1d8ea7f48
treed0c27770e789da46d4b1b0cd361a7b83547d60ff
parentdf535364356dcd16af68659298f0ca959f412f16
journal: Invert verify entry <=> data consistency checks

Previously, for each entry in a data object's entry array, we'd check
if one of that entry's entry items referred to the data object.

Instead, when verifying the main entry array, let's check if for each
entry item found by iterating the main entry array, the corresponding
data object's entry array refers to that entry.

This enables us to re-use more code from journal-file and turns out to
be roughly 10s faster when verifying my 4G laptop journal.

When verifying data objects, we still check if every entry in the data
object's entry array also exists in the main entry array so that we ensure
we're not missing any entries when iterating the main entry array.
src/libsystemd/sd-journal/journal-file.c
src/libsystemd/sd-journal/journal-file.h
src/libsystemd/sd-journal/journal-verify.c