diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-10-18 04:12:25 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-10-18 04:12:25 +0200 |
commit | 0598fd4a9548fbe0b642d7ef6eb0ed490ec0ee0f (patch) | |
tree | a9c5bcb43ef426b3e6699035c8ef73827493cb20 | |
parent | journalctl: move access check before the first access to the journal files (diff) | |
download | systemd-0598fd4a9548fbe0b642d7ef6eb0ed490ec0ee0f.tar.xz systemd-0598fd4a9548fbe0b642d7ef6eb0ed490ec0ee0f.zip |
journal: suggest rotation when fields are not indexed
-rw-r--r-- | src/journal/journal-file.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 43fd4453a4..edf8e7dd5e 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -2753,6 +2753,13 @@ bool journal_file_rotate_suggested(JournalFile *f, usec_t max_file_usec) { return true; } + /* Are the data objects properly indexed by field objects? */ + if (JOURNAL_HEADER_CONTAINS(f->header, n_data) && + JOURNAL_HEADER_CONTAINS(f->header, n_fields) && + le64toh(f->header->n_data) > 0 && + le64toh(f->header->n_fields) == 0) + return true; + if (max_file_usec > 0) { usec_t t, h; |