chiark / gitweb /
journal: it's not a problem if the realtime jumps, hence don't ensure monotonicity...
[elogind.git] / src / journal / journal-file.c
index 977cfa1010f8a57ae057a4b3412e65c907368d0a..4de1daf6a0b177bed7105fc32ea493cc8da4a95c 100644 (file)
@@ -332,11 +332,11 @@ static int journal_file_move_to(JournalFile *f, int wt, uint64_t offset, uint64_
 
                 delta = PAGE_ALIGN((DEFAULT_WINDOW_SIZE - size) / 2);
 
-                if (offset < delta)
+                if (delta > offset)
                         delta = offset;
 
                 offset -= delta;
-                size += (DEFAULT_WINDOW_SIZE - delta);
+                size = DEFAULT_WINDOW_SIZE;
         } else
                 delta = 0;
 
@@ -1016,9 +1016,6 @@ int journal_file_append_entry(JournalFile *f, const dual_timestamp *ts, const st
             ts->monotonic < le64toh(f->header->tail_entry_monotonic))
                 return -EINVAL;
 
-        if (ts->realtime < le64toh(f->header->tail_entry_realtime))
-                return -EINVAL;
-
         items = alloca(sizeof(EntryItem) * n_iovec);
 
         for (i = 0; i < n_iovec; i++) {