generic_array_get() which is used for the unfiltered iteration path in the previous commit treats a chain pointer that resolves past the end of the file as the end of the chain. In that case, moving to the missing array object returns -EADDRNOTAVAIL (or -EBADMSG), and it either stops (going downwards) or steps back to the previous array (going upwards). However, generic_array_bisect(), which is used for filtered or seeking reads does not. On -EADDRNOTAVAIL/-EBADMSG from journal_file_move_to_object(), it instead returns the error directly to the caller, which propagates out through sd_journal_next()/sd_journal_previous() and aborts the query. The per-data entry array chain has the same issue as the global one, since n_entries and entry_array_offset are (re)written in place as entries are linked, and thus after a crash they can reference more arrays than actually reached the disk. That is to say in practical terms, a journal recovered for reading by the previous commit could nevertheless still drop matching entries from `journalctl FIELD=value`, and a seqnum or time seek into the lost region could fail outright. Let's give generic_array_bisect() the same tolerance generic_array_get() already has. That is, when moving to an entry array object fails, treat the chain as ending at the previous array. This means that the result matches what generic_array_get() would yield for the same file.
System and Service Manager
Details
Most documentation is available on systemd's web site.
Assorted, older, general information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Code Map for information about this repository's layout and content.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list, join our IRC channel #systemd on libera.chat or Matrix channel
Stable branches with backported patches are available in the stable repo.
We have a security bug bounty program sponsored by the Sovereign Tech Fund hosted on YesWeHack
Repositories with distribution packages built from git main are available on OBS, and also repositories with packages built from the latest stable release
