journal: Stop comparing hash values from entry items against data objects
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 1 Nov 2021 14:33:08 +0000 (14:33 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 26 Jan 2022 20:16:00 +0000 (20:16 +0000)
commit8bad5453543dc27054380636e9809256d6906dfd
treeaada8ad619dfb17ceea10796ecae23ecb36dcb8f
parentc710944c836e2dd18c933c3f1b9900f18e4eceb7
journal: Stop comparing hash values from entry items against data objects

These checks don't achieve anything of value. Assuming they were added to
check for corruption, they don't actually achieve this goal since other parts
of the data object can still get corrupted and we wouldn't notice unless we'd
recalculate the hash every time.

In theory, we could use the entry item hash to avoid a random access lookup
for the data object hash in the journal file in the future to speed up searching,
but for finding all entry objects containing a specific data objects, we already
have entry arrays per data object to get fast access to this information.

This means that duplicating the hashes in the entry item doesn't result in any
added value. In this commit, we remove the checks so that in future commits we
can remove the hashes from the journal file format in the new compact mode.
src/libsystemd/sd-journal/journal-file.c
src/libsystemd/sd-journal/journal-verify.c
src/libsystemd/sd-journal/sd-journal.c