From: Yu Watanabe Date: Mon, 1 May 2023 05:12:38 +0000 (+0900) Subject: sd-journal: read entry array object again X-Git-Tag: v254-rc1~586^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9b61db922404a216de018cc5ddff9b69bcaf1db;p=thirdparty%2Fsystemd.git sd-journal: read entry array object again Otherwise, the object may be invalidated by the previous call of journal_file_move_to_object(). --- diff --git a/src/libsystemd/sd-journal/journal-file.c b/src/libsystemd/sd-journal/journal-file.c index 81bedfd7221..c59d2b07c66 100644 --- a/src/libsystemd/sd-journal/journal-file.c +++ b/src/libsystemd/sd-journal/journal-file.c @@ -2715,8 +2715,13 @@ static int generic_array_get( return r; /* OK, so this entry is borked. Most likely some entry didn't get synced to - * disk properly, let's see if the next one might work for us instead. */ + * disk properly, let's see if the next one might work for us instead. */ log_debug_errno(r, "Entry item %" PRIu64 " is bad, skipping over it.", i); + + r = journal_file_move_to_object(f, OBJECT_ENTRY_ARRAY, a, &o); + if (r < 0) + return r; + } while (bump_array_index(&i, direction, k) > 0); r = bump_entry_array(f, o, a, first, direction, &a);