journal: Improve handling of corruption during upwards entry iteration
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 7 Feb 2022 20:19:29 +0000 (20:19 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 7 Feb 2022 20:40:30 +0000 (20:40 +0000)
commit952d1e784a0ad47e0c2c832d28299987c3c25529
tree01358ce852cb1e10facf3449fcc619e49e4893d4
parentaa00163d79309f9873512a4cc14a48c05fee7c65
journal: Improve handling of corruption during upwards entry iteration

If we're going upwards in the journal file during entry iteration and we
can't reach the current entry due to corruption, start iterating upwards
from the last reachable entry array. This is equivalent to skipping
all entries in the array that can't be reached anymore.

Fixes #22431
src/libsystemd/sd-journal/journal-file.c