]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-journal: always fallback to find entry by realtime
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 24 Sep 2023 17:00:41 +0000 (02:00 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 26 Sep 2023 04:26:22 +0000 (13:26 +0900)
commit304cb08f84b6aea8962035340c9a83f54541cf77
treefdfee078e61aa5d24941950bb0652e6abc32091b
parent7c1784db8329220b8cbc0a05cb79d36593fb12b8
sd-journal: always fallback to find entry by realtime

Consider the following situation:
- There are two journal files (x and y), that contains entries for two boots (X and Y).
- The journal file x contains entries of the boot X, and y contains
  entries of Y.
- Nevertheless x does not contains entries of boot Y, it contains
  the _BOOT_ID= data object of boot Y. Of course, the data object is not
  referenced by any entries in the journal file x.

In such situation, when the current location of sd_journal is the head
of journal y, that is, the first entry of the boot Y,
sd_journal_previous() failed without this change, and
'journalctl --boot -NUM' for boot X failed.

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