[Devel] [PATCH criu-stable] pid-reuse: temporary use stat file from cwd if has no parent stats

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Wed Apr 18 10:47:37 MSK 2018


We will eventually switch from stats file to inventory image, as the
former is a wrong place for dump_uptime anyway. But for now to reenable
pid-reuse detection for vz7 CT's we can read dump_uptime of a previous
pre-dump from stats file in cwd, as libvzctl sets for all iterations
same workdir, and as we read it before cr_*dump_finish (before we
overwrote it).

https://jira.sw.ru/browse/PSBM-82864

Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 criu/stats.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/criu/stats.c b/criu/stats.c
index d344ad336..ff4167019 100644
--- a/criu/stats.c
+++ b/criu/stats.c
@@ -226,6 +226,12 @@ StatsEntry *get_parent_stats(void)
 	}
 
 	img = open_image_at(dir, CR_FD_STATS, O_RSTR, "dump");
+	if (!img)
+		/*
+		 * Temporary fallback to reading stats of a previous pre-dump
+		 * from a workdir. https://jira.sw.ru/browse/PSBM-82864
+		 */
+		img = open_image_at(AT_FDCWD, CR_FD_STATS, O_RSTR, "dump");
 	if (!img) {
 		pr_warn("Failed to open parent dump stats");
 		close(dir);
-- 
2.14.3



More information about the Devel mailing list