chiark / gitweb /
journal: rotate busy files away when we try to write to them
authorLennart Poettering <lennart@poettering.net>
Thu, 19 Jul 2012 01:21:04 +0000 (03:21 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 19 Jul 2012 01:21:04 +0000 (03:21 +0200)
src/journal/journal-file.c

index 9efa82cbe094eb0a136b7a089934ef458b18cba1..b840124c9fe8815329ac643ef991286a2ee94c62 100644 (file)
@@ -2142,7 +2142,9 @@ int journal_file_open_reliably(
         if (r != -EBADMSG && /* corrupted */
             r != -ENODATA && /* truncated */
             r != -EHOSTDOWN && /* other machine */
-            r != -EPROTONOSUPPORT) /* incompatible feature */
+            r != -EPROTONOSUPPORT && /* incompatible feature */
+            r != -EBUSY && /* unclean shutdown */
+            r != -ESHUTDOWN /* already archived */)
                 return r;
 
         if ((flags & O_ACCMODE) == O_RDONLY)
@@ -2165,7 +2167,7 @@ int journal_file_open_reliably(
         if (r < 0)
                 return -errno;
 
-        log_warning("File %s corrupted, renaming and replacing.", fname);
+        log_warning("File %s corrupted or uncleanly shut down, renaming and replacing.", fname);
 
         return journal_file_open(fname, flags, mode, metrics, template, ret);
 }