summaryrefslogtreecommitdiff
path: root/src/journal/journald-server.c
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2016-12-02 18:40:10 +0100
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-12-17 00:52:41 -0500
commit072c78e8626a7de7ae9fefc78bff270a357e467d (patch)
tree9f40c3e88b8db7ef9accaecade684ff83d0cb412 /src/journal/journald-server.c
parent26b48b3d0d3987c565cdb4209a2606f7c4ad84f0 (diff)
journal: make sure to initially populate the space info cache (#4807)
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
Diffstat (limited to 'src/journal/journald-server.c')
-rw-r--r--src/journal/journald-server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 908c7b8eeb..50bd83fc6e 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -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);