summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-01-26 17:24:15 +0100
committerLennart Poettering <lennart@poettering.net>2023-02-21 10:47:53 +0100
commitced1196802035ea07290f49009886047a513fe32 (patch)
tree3487864dd460f989c1f3d2362111eb98c1b94dc1
parentjournal-file: allow opening journal files for write when machine ID is not in... (diff)
downloadsystemd-ced1196802035ea07290f49009886047a513fe32.tar.xz
systemd-ced1196802035ea07290f49009886047a513fe32.zip
journal-file: drop checking if files are from the future at time of open
We nowadays check for ordering anyway at time of writing entries, hence we don't have to do that at moment of opening, too. Benefit of dropping this check: we can safely archive files from the future instead of marking them as broken.
-rw-r--r--src/journal/journald-server.c4
-rw-r--r--src/journal/managed-journal-file.c3
-rw-r--r--src/libsystemd/sd-journal/journal-file.c8
3 files changed, 1 insertions, 14 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index dd31007a4d..de08c4e965 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -873,10 +873,6 @@ static bool shall_try_append_again(JournalFile *f, int r) {
log_ratelimit_warning(JOURNAL_LOG_RATELIMIT, "%s: Journal file has been deleted, rotating.", f->path);
return true;
- case -ETXTBSY: /* Journal file is from the future */
- log_ratelimit_warning(JOURNAL_LOG_RATELIMIT, "%s: Journal file is from the future, rotating.", f->path);
- return true;
-
case -EREMCHG: /* Wallclock time (CLOCK_REALTIME) jumped backwards relative to last journal entry */
log_ratelimit_warning(JOURNAL_LOG_RATELIMIT, "%s: Realtime clock jumped backwards relative to last journal entry, rotating.", f->path);
return true;
diff --git a/src/journal/managed-journal-file.c b/src/journal/managed-journal-file.c
index 81aecfe7cb..538d999de0 100644
--- a/src/journal/managed-journal-file.c
+++ b/src/journal/managed-journal-file.c
@@ -542,8 +542,7 @@ int managed_journal_file_open_reliably(
-EBUSY, /* Unclean shutdown */
-ESHUTDOWN, /* Already archived */
-EIO, /* IO error, including SIGBUS on mmap */
- -EIDRM, /* File has been deleted */
- -ETXTBSY)) /* File is from the future */
+ -EIDRM)) /* File has been deleted */
return r;
if ((open_flags & O_ACCMODE) == O_RDONLY)
diff --git a/src/libsystemd/sd-journal/journal-file.c b/src/libsystemd/sd-journal/journal-file.c
index 05c66815ae..b1064a6982 100644
--- a/src/libsystemd/sd-journal/journal-file.c
+++ b/src/libsystemd/sd-journal/journal-file.c
@@ -537,14 +537,6 @@ static int journal_file_verify_header(JournalFile *f) {
if (f->header->field_hash_table_size == 0 || f->header->data_hash_table_size == 0)
return -EBADMSG;
-
- /* Don't permit appending to files from the future. Because otherwise the realtime timestamps wouldn't
- * be strictly ordered in the entries in the file anymore, and we can't have that since it breaks
- * bisection. */
- if (le64toh(f->header->tail_entry_realtime) > now(CLOCK_REALTIME))
- return log_debug_errno(SYNTHETIC_ERRNO(ETXTBSY),
- "Journal file %s is from the future, refusing to append new data to it that'd be older.",
- f->path);
}
return 0;