From 5a2a2a190983da835ffe56631de57ac50591b909 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 21 Mar 2012 23:40:51 +0100 Subject: [PATCH] journal: react with immediate rotation to a couple of more errors --- src/journal/journal-file.c | 5 ++++- src/journal/journald.c | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 474dd5ca..5d540a7d 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -1887,7 +1887,10 @@ int journal_file_open_reliably( char *p; r = journal_file_open(fname, flags, mode, template, ret); - if (r != -EBADMSG) + if (r != -EBADMSG && /* corrupted */ + r != -ENODATA && /* truncated */ + r != -EHOSTDOWN && /* other machine */ + r != -EPROTONOSUPPORT) /* incompatible feature */ return r; if ((flags & O_ACCMODE) == O_RDONLY) diff --git a/src/journal/journald.c b/src/journal/journald.c index baad3ab1..d27cb60a 100644 --- a/src/journal/journald.c +++ b/src/journal/journald.c @@ -609,7 +609,15 @@ retry: else { r = journal_file_append_entry(f, NULL, iovec, n, &s->seqnum, NULL, NULL); - if ((r == -EBADMSG || r == -E2BIG) && !vacuumed) { + if ((r == -E2BIG || /* hit limit */ + r == -EFBIG || /* hit fs limit */ + r == -EDQUOT || /* quota hit */ + r == -ENOSPC || /* disk full */ + r == -EBADMSG || /* corrupted */ + r == -ENODATA || /* truncated */ + r == -EHOSTDOWN || /* other machine */ + r == -EPROTONOSUPPORT) && /* unsupported feature */ + !vacuumed) { if (r == -E2BIG) log_info("Allocation limit reached, rotating."); -- 2.39.5