chiark / gitweb /
journald: be more careful when we try to flush the runtime journal to disk and the... v203
authorLennart Poettering <lennart@poettering.net>
Mon, 6 May 2013 23:09:33 +0000 (01:09 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 6 May 2013 23:10:05 +0000 (01:10 +0200)
Bump the minimal size of the journal so that we can be sure creating the
journal file will always succeed. Previously the minimum size was
smaller than a empty jounral file...

src/journal/journal-file.c
src/journal/journald-server.c

index 6eb905e..38499a6 100644 (file)
@@ -44,7 +44,7 @@
 #define COMPRESSION_SIZE_THRESHOLD (512ULL)
 
 /* This is the minimum journal file size */
-#define JOURNAL_FILE_SIZE_MIN (64ULL*1024ULL)                  /* 64 KiB */
+#define JOURNAL_FILE_SIZE_MIN (4ULL*1024ULL*1024ULL)           /* 4 MiB */
 
 /* These are the lower and upper bounds if we deduce the max_use value
  * from the file system size */
index 1b5a22b..88163c0 100644 (file)
@@ -938,6 +938,12 @@ int server_flush_to_var(Server *s) {
                 server_rotate(s);
                 server_vacuum(s);
 
+                if (!s->system_journal) {
+                        log_notice("Didn't flush runtime journal since rotation of system journal wasn't successful.");
+                        r = -EIO;
+                        goto finish;
+                }
+
                 log_debug("Retrying write.");
                 r = journal_file_copy_entry(f, s->system_journal, o, f->current_offset, NULL, NULL, NULL);
                 if (r < 0) {