From: Zbigniew Jędrzejewski-Szmek Date: Sun, 30 Mar 2014 18:20:34 +0000 (-0400) Subject: journal: allow files with no data whatsoever X-Git-Tag: v216~604 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=b3306e9c3c1e036396bc6bf74555eecea3f45ad9 journal: allow files with no data whatsoever If a file was opened for writing, and then closed immediately without actually writing any entries, on subsequent opening, it would be considered "corrupted". This should be totally fine, and even in read mode, an empty file can become non-empty later on. --- diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index dc041dd58..6679ea46d 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -279,12 +279,6 @@ static int journal_file_verify_header(JournalFile *f) { !VALID64(le64toh(f->header->entry_array_offset))) return -ENODATA; - if (le64toh(f->header->data_hash_table_offset) < le64toh(f->header->header_size) || - le64toh(f->header->field_hash_table_offset) < le64toh(f->header->header_size) || - le64toh(f->header->tail_object_offset) < le64toh(f->header->header_size) || - le64toh(f->header->entry_array_offset) < le64toh(f->header->header_size)) - return -ENODATA; - if (f->writable) { uint8_t state; sd_id128_t machine_id;