From 858749f7312bd0adb5433075a92e1c35a2fb56ac Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 8 Feb 2018 20:11:43 +0100 Subject: sd-journal: properly handle inotify queue overflow This adds proper handling of IN_Q_OVERFLOW: when the inotify queue runs over we'll reiterate all directories we are looking at. At the same time we'll mark all files and directories we encounter that way with a generation counter we first increased. All files and directories not marked like this are then unloaded. With this logic we do the best when the inotify queue overflows: we synchronize our in-memory state again with what's on disk. This contains some refactoring of the directory logic, to share more code between uuid directories and "root" directories and generally make things a bit more readable by splitting things up into smaller bits. See: #7998 #8032 --- src/journal/journal-file.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/journal/journal-file.h') diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h index c5cfa3d878..67abf8da49 100644 --- a/src/journal/journal-file.h +++ b/src/journal/journal-file.h @@ -122,6 +122,8 @@ typedef struct JournalFile { pthread_t offline_thread; volatile OfflineState offline_state; + unsigned last_seen_generation; + #if HAVE_XZ || HAVE_LZ4 void *compress_buffer; size_t compress_buffer_size; -- cgit v1.2.3