We would fail if the input file was corrupted:
build/test-journal-flush ./system@
0005b7dac334f805-
0021aca076ae5c5e.journal\~
journal_file_copy_entry failed: Bad message
Assertion 'r >= 0' failed at src/libsystemd/sd-journal/test-journal-flush.c:55, function main(). Aborting.
[1] 619472 IOT instruction (core dumped) build/test-journal-flush ./system@
0005b7dac334f805-
0021aca076ae5c5e.journal\~
Let's skip some "reasonable" errors.
Fixes #17963.
r = journal_file_copy_entry(f, new_journal, o, f->current_offset);
if (r < 0)
- log_error_errno(r, "journal_file_copy_entry failed: %m");
- assert_se(r >= 0);
+ log_warning_errno(r, "journal_file_copy_entry failed: %m");
+ assert_se(r >= 0 ||
+ IN_SET(r, -EBADMSG, /* corrupted file */
+ -EPROTONOSUPPORT, /* unsupported compression */
+ -EIO)); /* file rotated */
if (++n >= 10000)
break;