]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: make sure to initially populate the space info cache (#4807)
authorFranck Bui <fbui@suse.com>
Fri, 2 Dec 2016 17:40:10 +0000 (18:40 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 2 Dec 2016 17:40:10 +0000 (18:40 +0100)
Make sure to populate the cache in cache_space_refresh() at least once
otherwise it's possible that the system boots fast enough (and the journal
flush service is finished) before the invalidate cache timeout (30 us) has
expired.

Fixes: #4790
src/journal/journald-server.c

index 28487a9451acb150c238796bc2a17e23359ab4dc..5c6941ebd616527ae560386840344d1204de8f42 100644 (file)
@@ -144,7 +144,7 @@ static int cache_space_refresh(Server *s, JournalStorage *storage) {
 
         ts = now(CLOCK_MONOTONIC);
 
-        if (space->timestamp + RECHECK_SPACE_USEC > ts)
+        if (space->timestamp != 0 && space->timestamp + RECHECK_SPACE_USEC > ts)
                 return 0;
 
         r = determine_path_usage(s, storage->path, &vfs_used, &vfs_avail);