|
Zbigniew Jędrzejewski-Szmek |
5d6eed |
From dc28516400f7f56a4a6fbc8ab6740d2dc98f99ea Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
From: Franck Bui <fbui@suse.com>
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
Date: Fri, 2 Dec 2016 18:40:10 +0100
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
Subject: [PATCH] journal: make sure to initially populate the space info cache
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
(#4807)
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
Make sure to populate the cache in cache_space_refresh() at least once
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
otherwise it's possible that the system boots fast enough (and the journal
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
flush service is finished) before the invalidate cache timeout (30 us) has
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
expired.
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
Fixes: #4790
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
(cherry picked from commit 3099caf2b5bb9498b1d0227c40926435ca81f26f)
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
---
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
src/journal/journald-server.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
index c0987625cd..1d2fce8dc7 100644
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
--- a/src/journal/journald-server.c
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
+++ b/src/journal/journald-server.c
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
@@ -144,7 +144,7 @@ static int cache_space_refresh(Server *s, JournalStorage *storage) {
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
ts = now(CLOCK_MONOTONIC);
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
- if (space->timestamp + RECHECK_SPACE_USEC > ts)
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
+ if (space->timestamp != 0 && space->timestamp + RECHECK_SPACE_USEC > ts)
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
return 0;
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
|
|
Zbigniew Jędrzejewski-Szmek |
03e93e |
r = determine_path_usage(s, storage->path, &vfs_used, &vfs_avail);
|